• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

Chapter 15. Layout > Class FormLayout

15.8. Class FormLayout

FormLayout is perhaps the most general and flexible layout in SWT. The layout algorithm is based on the concept of attachments. An attachment attaches the edge of one control either to the edge of another control or to a position within a composite. This very simple principle allows complex user interfaces to be created one element at a time. FormLayout has a further advantage over other layouts because it does not depend on the child order of the composite. This means that it is less sensitive to code changes and behaves better when controls are added and removed, either dynamically or when the code that creates the controls is updated.

It has one major disadvantage when compared with GridLayout. Because FormLayout has no concept of rows or columns, when attachments are used to create rows or columns of controls, FormLayout cannot automatically determine the largest control in the row or column and resize the other controls to match.


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


  
  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint