GridBagLayout

This layout is more flexible than the grid layout. This layout allows the components span over multiple rows and columns. This layout also enables us to resize the components by assigning appropriate weights to them. The following snippet assigns the gridbag layout : gridbagLayout lay = new GridLayout (); setLayout (lay ); The data members … Read more…

GridBagLayout : gridwidth, gridheight and fill

The gridwidth variable lets you specify the number of columns in the display area of the component. The default value is 1 Pixel. To specify that a component use the remaining space in a row, use GridBagConstraints.REMAINDER. To specify that a component use the next-to-last cell in a row, use GridBagConstraints.RELATIVE. The gridheight constraint works … Read more…