Optimization for jar compiling

Some things won't work without compiling anymore (like creating a profiles file).
Downloading jars is finished.
This commit is contained in:
2018-02-13 12:21:39 +01:00
parent b662afe0c6
commit 5d471881fb
8 changed files with 326 additions and 71 deletions

View File

@ -540,7 +540,7 @@ public class GUI implements ActionListener {
String serverName = JOptionPane.showInputDialog("Name of server: ");
Profile.getCurrent().addCollection(serverName);
this.update();
ServerConsoles.update();
Profile.getCurrent().updateConsoles();
} else if (e.getSource() == backup) {
backup();
} else if (e.getSource() == addProfile) {
@ -591,12 +591,12 @@ public class GUI implements ActionListener {
*/
private void changeProfile() {
Profile.getCurrent().save();
Object current = profiles.getSelectedItem();
Object current = this.profiles.getSelectedItem();
if (current != null) {
Profile.setCurrent(current.toString());
}
update();
ServerConsoles.update();
this.update();
Profile.getCurrent().updateConsoles();
}
/**
@ -614,6 +614,7 @@ public class GUI implements ActionListener {
"Error",
JOptionPane.ERROR_MESSAGE
);
e1.printStackTrace();
}
}

View File

@ -36,10 +36,8 @@ public class ServerConsoles {
public static void show() {
frame.setVisible(true);
}
public static void update() {
consolesTab.removeAll();
for (Collection collection : Profile.getCurrent().getCollections()) {
consolesTab.add(collection.getName(), collection.getServerConsole().getPanel());
}
public static JTabbedPane getTab() {
return consolesTab;
}
}

View File

@ -172,7 +172,7 @@ public class ServerTab implements ActionListener {
private void remove() {
Profile.getCurrent().removeCollection(name);
Main.gui().update();
ServerConsoles.update();
Profile.getCurrent().updateConsoles();
}
private void browse() {