- int row = 0;
-
- public GridBagConstraints constraints (int x, int width, int fill) {
- GridBagConstraints c = new GridBagConstraints();
- Insets insets = new Insets(4, 4, 4, 4);
-
- c.insets = insets;
- c.fill = fill;
- if (width == 3)
- c.anchor = GridBagConstraints.CENTER;
- else if (x == 2)
- c.anchor = GridBagConstraints.EAST;
- else
- c.anchor = GridBagConstraints.WEST;
- c.gridx = x;
- c.gridwidth = width;
- c.gridy = row;
- return c;
- }
-
- public GridBagConstraints constraints(int x, int width) {
- return constraints(x, width, GridBagConstraints.NONE);
- }
-