Tutorial by Examples

In this example, we use the default, no-args GridLayout() constructor to create a layout with a single column. public class SingleColumnGridLayoutExample { private final Display display; private final Shell shell; public SingleColumnGridLayoutExample() { display = new Di...
Similar to the Single-Column Example above, if we instead use the GridLayout(int, boolean) constructor, we can create a layout with multiple columns. In this case we create two columns, each of which are the same width. public class MultiColumnGridLayoutExample { private final Display displ...
By leveraging some of the member variables in the GridLayout instance, we can change the margins around the layout, and spacing between cells. In this example we set the following: verticalSpacing = 0 - Sets the vertical spacing between cells to 0px. horizontalSpacing = 20 - Sets the horizontal ...

Page 1 of 1