Preferences - Swing - GridBagLayout

This page is used to control various Swing GridBagLayout options.

Use empty constructor for GBL constraints

This preference determines whether Designer generates empty GridBagLayout constructors or fully populated constructors. When empty constructors are used, individual GridBagConstraint values are set by accessing the appropriate fields. For example:
JButton myButton = new JButton();
GridBagConstraints gridBagConstraints = new GridBagConstraints();
gridBagConstraints.insets = new Insets(0, 0, 12, 23);
gridBagConstraints.ipady = 30;
gridBagConstraints.ipadx = 26;
gridBagConstraints.gridy = 1;
gridBagConstraints.gridx = 1;
getContentPane().add(myButton, gridBagConstraints);
myButton.setText("New JButton");

When fully populated constructors are used, all of the GridBagConstraint values are set in the constructor. For example:

JButton myButton = new JButton();
getContentPane().add(myButton, new GridBagConstraints(1, 1, 1, 1, 0.0, 0.0,
    GridBagConstraints.CENTER, GridBagConstraints.NONE, 
    new Insets(0, 0, 10, 24), 39, 33));
myButton.setText("New JButton");

Show green cell spanning handles

This preference controls whether Designer displays green cell spanning handles in when a grid bag cell is selected in the design pane.

   

Show blue cell inset handles

This preference controls whether Designer displays blue cell inset handles in when a grid bag cell is selected in the design pane.

   

Show cell fill handles

This preference controls whether Designer displays horizontal and vertical fill handles in when a grid bag cell is selected in the design pane.

   

Show handle tooltips

This preference controls whether Designer displays tooltips for each handle. Turning this option on will make it easier to differentiate between the different handles.

Default Insets

This preference controls the default insets that Designer uses when creating a new widget.