Fixes issue #2

This commit is contained in:
Kristian Knarvik 2018-02-20 17:45:30 +01:00
parent 379d1ed051
commit 16edbfd44c

View File

@ -286,6 +286,7 @@ public class GUI implements ActionListener {
targetServer = new JComboBox<>(); targetServer = new JComboBox<>();
sl_panel_1.putConstraint(SpringLayout.NORTH, targetServer, 10, SpringLayout.NORTH, controlServers); sl_panel_1.putConstraint(SpringLayout.NORTH, targetServer, 10, SpringLayout.NORTH, controlServers);
controlServers.add(targetServer); controlServers.add(targetServer);
targetServer.addActionListener(this);
targetPlayer = new JComboBox<>(); targetPlayer = new JComboBox<>();
sl_panel_1.putConstraint(SpringLayout.NORTH, targetPlayer, 6, SpringLayout.SOUTH, targetServer); sl_panel_1.putConstraint(SpringLayout.NORTH, targetPlayer, 6, SpringLayout.SOUTH, targetServer);
@ -508,6 +509,8 @@ public class GUI implements ActionListener {
background(); background();
} else if (e.getSource() == chckbxmntmDelayStartup) { } else if (e.getSource() == chckbxmntmDelayStartup) {
delay(); delay();
} else if (e.getSource() == targetServer) {
updatePlayers();
} else if (e.getSource() == chckbxmntmDownloadJars) { } else if (e.getSource() == chckbxmntmDownloadJars) {
downloadJars(); downloadJars();
} else if (e.getSource() == mntmErrors) { } else if (e.getSource() == mntmErrors) {
@ -752,7 +755,9 @@ public class GUI implements ActionListener {
targetPlayer.removeAllItems(); targetPlayer.removeAllItems();
selectedServerValue = selectedServer.toString(); selectedServerValue = selectedServer.toString();
if (selectedServerValue.equals("All")) { if (selectedServerValue.equals("All")) {
for (String player : this.globalPlayers) targetPlayer.addItem(player); for (String player : this.globalPlayers) {
targetPlayer.addItem(player);
}
} else { } else {
for (String player : Profile.getCurrent().getCollection(selectedServerValue).getServer().getPlayers()) { for (String player : Profile.getCurrent().getCollection(selectedServerValue).getServer().getPlayers()) {
targetPlayer.addItem(player); targetPlayer.addItem(player);