by, 03-04-2012 at 04:24 PM (432 Views)
Components are arranged into grid of columns and rows by the GridBag Layout just the way grid layout manager did so. It also lets you to do the proper specification of the settings so that the components are positioned and sized in cells.
It is not necessary for all components to be of one uniformed size. E.g. componentís position at grid can be changed or can be spanned to various columns & rows.
Components present in longest row are used by the layout manager. Moreover, componentís size and created rows are used to find out the size & no. of cells present in grid.
Component which spans the set of cells are referred to display area. Display area of a component and the method by which display area gets filled are defined by constraint sets which are presented by the help of object GridBagConstraints. Following constraints are present.