Skip to content
Snippets Groups Projects
Commit dd0d8e0c authored by Daniel Schramm's avatar Daniel Schramm
Browse files

Gridwidth moved out of the addButtonCustom method

parent 4dc74873
No related branches found
No related tags found
No related merge requests found
......@@ -240,6 +240,7 @@ public class ControlPanelBuilder {
c.insets = new Insets(2, 0, 40, 0); // small external space on top and bottom
c.weighty = 1.0; //request any extra vertical space
c.anchor = GridBagConstraints.PAGE_END;
c.gridwidth = BUTTON_WIDTH;
List<JButton> retButtons = new ArrayList<>();
for (int i = 0; i < buttons.size(); i++) {
......@@ -260,6 +261,7 @@ public class ControlPanelBuilder {
public JButton addButton(String caption, ActionListener action) {
final GridBagConstraints c = new GridBagConstraints();
c.anchor = GridBagConstraints.LINE_START;
c.gridwidth = BUTTON_WIDTH;
return addButtonCustom(caption, action, c);
}
......@@ -277,10 +279,9 @@ public class ControlPanelBuilder {
button.setText(caption);
button.addActionListener(action);
constraints.gridwidth = BUTTON_WIDTH;
constraints.gridy = row;
constraints.gridx = col;
col += BUTTON_WIDTH;
col += constraints.gridwidth;
constraints.fill = GridBagConstraints.NONE;
controlPanel.add(button, constraints);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment