Changed layout to have buttons fill width.

This commit is contained in:
neviyn 2016-03-13 22:46:57 +00:00
parent b0c1dd10bc
commit b0c1098110

View File

@ -28,16 +28,20 @@ class LibraryConfigGUI {
listLibraryFolders.setModel(listModel); listLibraryFolders.setModel(listModel);
mainPanel.add(listLibraryFolders, BorderLayout.CENTER); mainPanel.add(listLibraryFolders, BorderLayout.CENTER);
final JPanel panel2 = new JPanel(); final JPanel panel2 = new JPanel();
panel2.setLayout(new BoxLayout(panel2, BoxLayout.PAGE_AXIS)); panel2.setLayout(new GridBagLayout());
GridBagConstraints constraints = new GridBagConstraints();
constraints.fill = GridBagConstraints.HORIZONTAL;
constraints.weightx = 1;
constraints.gridx = 0;
mainPanel.add(panel2, BorderLayout.EAST); mainPanel.add(panel2, BorderLayout.EAST);
JButton addNewButton = new JButton(); JButton addNewButton = new JButton();
addNewButton.setText("Add New"); addNewButton.setText("Add New");
addNewButton.addActionListener(e -> addNew()); addNewButton.addActionListener(e -> addNew());
panel2.add(addNewButton); panel2.add(addNewButton, constraints);
JButton removeButton = new JButton(); JButton removeButton = new JButton();
removeButton.setText("Remove"); removeButton.setText("Remove");
removeButton.addActionListener(e -> removeSelected()); removeButton.addActionListener(e -> removeSelected());
panel2.add(removeButton); panel2.add(removeButton, constraints);
return mainPanel; return mainPanel;
} }