This commit is contained in:
Kristian Knarvik 2018-01-30 23:38:22 +01:00
parent 85e4fa4fc7
commit f085cab71f
3 changed files with 7 additions and 10 deletions

View File

@ -12,8 +12,8 @@ import java.awt.*;
* @since 0.0.0.1 * @since 0.0.0.1
*/ */
class Console { class Console {
private JTextField textInput; private final JTextField textInput;
private JTextArea textOutput; private final JTextArea textOutput;
void output(String text) { void output(String text) {
this.textOutput.setText(text); this.textOutput.setText(text);

View File

@ -384,6 +384,8 @@ public class GUI implements ActionListener {
this.serversPane = tabbedPane_1; this.serversPane = tabbedPane_1;
tabbedPane_1.setTabLayoutPolicy(JTabbedPane.SCROLL_TAB_LAYOUT); tabbedPane_1.setTabLayoutPolicy(JTabbedPane.SCROLL_TAB_LAYOUT);
frame.setPreferredSize(frame.getPreferredSize());
frame.validate();
frame.setVisible(true); frame.setVisible(true);
} }
@ -426,12 +428,7 @@ public class GUI implements ActionListener {
goToURL("https://knarcraft.net/Bungeeminecraftserverlauncher/Story/"); goToURL("https://knarcraft.net/Bungeeminecraftserverlauncher/Story/");
} else if (e.getSource() == btnStartServer) { } else if (e.getSource() == btnStartServer) {
this.save(); this.save();
Executors.newSingleThreadExecutor().execute(new Runnable() { Executors.newSingleThreadExecutor().execute(Server::startServers);
@Override
public void run() {
Server.startServers();
}
});
} else if (e.getSource() == btnStopServer) { } else if (e.getSource() == btnStopServer) {
stop(); stop();
} else if (e.getSource() == addServer) { } else if (e.getSource() == addServer) {

View File

@ -17,8 +17,8 @@ import java.util.ArrayList;
public class ServerConsoles { public class ServerConsoles {
private static ServerConsoles serverConsoles; private static ServerConsoles serverConsoles;
private static ArrayList<Console> consoles = new ArrayList<>(); private static ArrayList<Console> consoles = new ArrayList<>();
private JFrame frame; private final JFrame frame;
private JTabbedPane consolesTab; private final JTabbedPane consolesTab;
public ServerConsoles() { public ServerConsoles() {
frame = new JFrame(); frame = new JFrame();