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

Chapter 9. SWT Layouts > Creating a GridLayout

9.9. Creating a GridLayout

GridLayout works somewhat like RowLayout, in that it controls placement of widgets in rows. However, GridLayout provides much more functionality than RowLayout, such as the ability to specify how many widgets wide a row should be, effectively enabling you to create a grid of rows and columns. Along with this extra functionality come even more additional settings that must be managed, making GridLayout much more complex than RowLayout.

The process for creating a GridLayout is slightly different from the process for creating either a RowLayout or a FillLayout. The process begins the same way—with the creation of an instance of the GridLayout class—but an additional setting must be specified: the number of columns in the grid. This setting controls the number of widgets that will make up a single row of the grid.


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


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