GUI is not shit anymore
This commit is contained in:
parent
6a668a2e17
commit
749af701a8
@ -119,14 +119,14 @@ public class GUI implements ActionListener {
|
||||
* Initialize the contents of the frame.
|
||||
*/
|
||||
private void initialize() {
|
||||
/*try {
|
||||
try {
|
||||
UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
|
||||
} catch (ClassNotFoundException | UnsupportedLookAndFeelException | InstantiationException | IllegalAccessException e) {
|
||||
e.printStackTrace();
|
||||
}*/
|
||||
}
|
||||
|
||||
frame = new JFrame("Minecraft server launcher");
|
||||
frame.setBounds(100, 100, 490, 219);
|
||||
frame.setBounds(100, 100, 470, 219);
|
||||
frame.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
|
||||
frame.setResizable(false);
|
||||
ImageIcon img;
|
||||
@ -281,42 +281,41 @@ public class GUI implements ActionListener {
|
||||
|
||||
targetServer = new JComboBox();
|
||||
sl_panel_1.putConstraint(SpringLayout.NORTH, targetServer, 10, SpringLayout.NORTH, controlServers);
|
||||
sl_panel_1.putConstraint(SpringLayout.SOUTH, targetServer, 30, SpringLayout.NORTH, controlServers);
|
||||
controlServers.add(targetServer);
|
||||
|
||||
targetPlayer = new JComboBox();
|
||||
sl_panel_1.putConstraint(SpringLayout.NORTH, targetPlayer, 6, SpringLayout.SOUTH, targetServer);
|
||||
sl_panel_1.putConstraint(SpringLayout.SOUTH, targetPlayer, 26, SpringLayout.SOUTH, targetServer);
|
||||
targetPlayer.setEditable(true);
|
||||
controlServers.add(targetPlayer);
|
||||
|
||||
btnKick = new JButton("Kick");
|
||||
sl_panel_1.putConstraint(SpringLayout.NORTH, btnKick, 9, SpringLayout.NORTH, controlServers);
|
||||
sl_panel_1.putConstraint(SpringLayout.NORTH, btnKick, 10, SpringLayout.NORTH, controlServers);
|
||||
sl_panel_1.putConstraint(SpringLayout.WEST, btnKick, 6, SpringLayout.EAST, targetServer);
|
||||
sl_panel_1.putConstraint(SpringLayout.SOUTH, btnKick, 32, SpringLayout.NORTH, controlServers);
|
||||
sl_panel_1.putConstraint(SpringLayout.EAST, btnKick, 124, SpringLayout.EAST, targetServer);
|
||||
sl_panel_1.putConstraint(SpringLayout.EAST, btnKick, 124, SpringLayout.WEST, btnKick);
|
||||
sl_panel_1.putConstraint(SpringLayout.SOUTH, targetServer, 0, SpringLayout.SOUTH, btnKick);
|
||||
controlServers.add(btnKick);
|
||||
btnKick.addActionListener(this);
|
||||
|
||||
btnBan = new JButton("Ban");
|
||||
sl_panel_1.putConstraint(SpringLayout.NORTH, btnBan, 35, SpringLayout.NORTH, controlServers);
|
||||
sl_panel_1.putConstraint(SpringLayout.NORTH, btnBan, 5, SpringLayout.SOUTH, btnKick);
|
||||
sl_panel_1.putConstraint(SpringLayout.WEST, btnBan, 6, SpringLayout.EAST, targetPlayer);
|
||||
sl_panel_1.putConstraint(SpringLayout.EAST, btnBan, 124, SpringLayout.EAST, targetPlayer);
|
||||
sl_panel_1.putConstraint(SpringLayout.EAST, btnBan, 124, SpringLayout.WEST, btnBan);
|
||||
sl_panel_1.putConstraint(SpringLayout.SOUTH, targetPlayer, 0, SpringLayout.SOUTH, btnBan);
|
||||
controlServers.add(btnBan);
|
||||
btnBan.addActionListener(this);
|
||||
|
||||
btnOp = new JButton("OP");
|
||||
sl_panel_1.putConstraint(SpringLayout.NORTH, btnOp, 9, SpringLayout.NORTH, controlServers);
|
||||
sl_panel_1.putConstraint(SpringLayout.NORTH, btnOp, 10, SpringLayout.NORTH, controlServers);
|
||||
sl_panel_1.putConstraint(SpringLayout.WEST, btnOp, 6, SpringLayout.EAST, btnKick);
|
||||
sl_panel_1.putConstraint(SpringLayout.SOUTH, btnOp, 32, SpringLayout.NORTH, controlServers);
|
||||
sl_panel_1.putConstraint(SpringLayout.EAST, btnOp, 124, SpringLayout.EAST, btnKick);
|
||||
//sl_panel_1.putConstraint(SpringLayout.SOUTH, btnOp, 32, SpringLayout.NORTH, controlServers);
|
||||
sl_panel_1.putConstraint(SpringLayout.EAST, btnOp, -10, SpringLayout.EAST, controlServers);
|
||||
controlServers.add(btnOp);
|
||||
btnOp.addActionListener(this);
|
||||
|
||||
btnDeop = new JButton("DEOP");
|
||||
sl_panel_1.putConstraint(SpringLayout.WEST, btnDeop, 6, SpringLayout.EAST, btnBan);
|
||||
sl_panel_1.putConstraint(SpringLayout.NORTH, btnDeop, 35, SpringLayout.NORTH, controlServers);
|
||||
sl_panel_1.putConstraint(SpringLayout.EAST, btnDeop, 124, SpringLayout.EAST, btnBan);
|
||||
sl_panel_1.putConstraint(SpringLayout.NORTH, btnDeop, 5, SpringLayout.SOUTH, btnOp);
|
||||
sl_panel_1.putConstraint(SpringLayout.EAST, btnDeop, -10, SpringLayout.EAST, controlServers);
|
||||
controlServers.add(btnDeop);
|
||||
btnDeop.addActionListener(this);
|
||||
|
||||
@ -324,13 +323,15 @@ public class GUI implements ActionListener {
|
||||
sl_panel_1.putConstraint(SpringLayout.WEST, targetServer, 6, SpringLayout.EAST, lblTargetServer);
|
||||
sl_panel_1.putConstraint(SpringLayout.EAST, targetServer, 121, SpringLayout.EAST, lblTargetServer);
|
||||
sl_panel_1.putConstraint(SpringLayout.NORTH, lblTargetServer, 10, SpringLayout.NORTH, controlServers);
|
||||
sl_panel_1.putConstraint(SpringLayout.SOUTH, lblTargetServer, 0, SpringLayout.SOUTH, targetServer);
|
||||
sl_panel_1.putConstraint(SpringLayout.WEST, lblTargetServer, 10, SpringLayout.WEST, controlServers);
|
||||
controlServers.add(lblTargetServer);
|
||||
|
||||
JLabel lblTargetPlayer = new JLabel("Target player");
|
||||
sl_panel_1.putConstraint(SpringLayout.WEST, targetPlayer, 7, SpringLayout.EAST, lblTargetPlayer);
|
||||
sl_panel_1.putConstraint(SpringLayout.EAST, targetPlayer, 122, SpringLayout.EAST, lblTargetPlayer);
|
||||
sl_panel_1.putConstraint(SpringLayout.NORTH, lblTargetPlayer, 12, SpringLayout.SOUTH, lblTargetServer);
|
||||
sl_panel_1.putConstraint(SpringLayout.NORTH, lblTargetPlayer, 6, SpringLayout.SOUTH, lblTargetServer);
|
||||
sl_panel_1.putConstraint(SpringLayout.SOUTH, lblTargetPlayer, 0, SpringLayout.SOUTH, targetPlayer);
|
||||
sl_panel_1.putConstraint(SpringLayout.WEST, lblTargetPlayer, 0, SpringLayout.WEST, lblTargetServer);
|
||||
controlServers.add(lblTargetPlayer);
|
||||
|
||||
@ -343,7 +344,8 @@ public class GUI implements ActionListener {
|
||||
customCommand = new JTextField();
|
||||
sl_panel_1.putConstraint(SpringLayout.WEST, customCommand, 10, SpringLayout.WEST, controlServers);
|
||||
sl_panel_1.putConstraint(SpringLayout.EAST, customCommand, -6, SpringLayout.WEST, btnCustomCommand);
|
||||
sl_panel_1.putConstraint(SpringLayout.NORTH, btnCustomCommand, -1, SpringLayout.NORTH, customCommand);
|
||||
sl_panel_1.putConstraint(SpringLayout.NORTH, btnCustomCommand, 0, SpringLayout.NORTH, customCommand);
|
||||
sl_panel_1.putConstraint(SpringLayout.SOUTH, customCommand, 0, SpringLayout.SOUTH, btnCustomCommand);
|
||||
controlServers.add(customCommand);
|
||||
customCommand.setColumns(10);
|
||||
|
||||
|
@ -28,9 +28,7 @@ public class ServerTab implements ActionListener {
|
||||
panel.setLayout(sl_panel_3);
|
||||
|
||||
JLabel lblServerType = new JLabel("Server type");
|
||||
sl_panel_3.putConstraint(SpringLayout.NORTH, lblServerType, 10, SpringLayout.NORTH, panel);
|
||||
sl_panel_3.putConstraint(SpringLayout.WEST, lblServerType, 10, SpringLayout.WEST, panel);
|
||||
sl_panel_3.putConstraint(SpringLayout.SOUTH, lblServerType, 30, SpringLayout.NORTH, panel);
|
||||
panel.add(lblServerType);
|
||||
|
||||
JLabel lblServerVersion = new JLabel("Server version");
|
||||
@ -42,6 +40,9 @@ public class ServerTab implements ActionListener {
|
||||
serverTypes = new JComboBox<>(ServerType.getTypeNames());
|
||||
sl_panel_3.putConstraint(SpringLayout.NORTH, serverTypes, 10, SpringLayout.NORTH, panel);
|
||||
sl_panel_3.putConstraint(SpringLayout.WEST, serverTypes, 5, SpringLayout.EAST, lblServerVersion);
|
||||
sl_panel_3.putConstraint(SpringLayout.EAST, serverTypes, 154, SpringLayout.WEST, serverTypes);
|
||||
sl_panel_3.putConstraint(SpringLayout.NORTH, lblServerType, 0, SpringLayout.NORTH, serverTypes);
|
||||
sl_panel_3.putConstraint(SpringLayout.SOUTH, lblServerType, 0, SpringLayout.SOUTH, serverTypes);
|
||||
panel.add(serverTypes);
|
||||
serverTypes.addActionListener(this);
|
||||
|
||||
@ -49,26 +50,27 @@ public class ServerTab implements ActionListener {
|
||||
sl_panel_3.putConstraint(SpringLayout.NORTH, serverVersions, 6, SpringLayout.SOUTH, serverTypes);
|
||||
sl_panel_3.putConstraint(SpringLayout.EAST, serverVersions, 0, SpringLayout.EAST, serverTypes);
|
||||
sl_panel_3.putConstraint(SpringLayout.WEST, serverVersions, 6, SpringLayout.EAST, lblServerVersion);
|
||||
sl_panel_3.putConstraint(SpringLayout.NORTH, lblServerVersion, 0, SpringLayout.NORTH, serverVersions);
|
||||
sl_panel_3.putConstraint(SpringLayout.SOUTH, lblServerVersion, 0, SpringLayout.SOUTH, serverVersions);
|
||||
panel.add(serverVersions);
|
||||
serverVersions.addActionListener(this);
|
||||
|
||||
JLabel lblMaxRam = new JLabel("Max ram");
|
||||
sl_panel_3.putConstraint(SpringLayout.EAST, serverTypes, -13, SpringLayout.WEST, lblMaxRam);
|
||||
sl_panel_3.putConstraint(SpringLayout.NORTH, lblMaxRam, 10, SpringLayout.NORTH, panel);
|
||||
sl_panel_3.putConstraint(SpringLayout.SOUTH, lblMaxRam, -92, SpringLayout.SOUTH, panel);
|
||||
sl_panel_3.putConstraint(SpringLayout.EAST, lblMaxRam, -111, SpringLayout.EAST, panel);
|
||||
sl_panel_3.putConstraint(SpringLayout.NORTH, lblMaxRam, 0, SpringLayout.NORTH, serverTypes);
|
||||
sl_panel_3.putConstraint(SpringLayout.SOUTH, lblMaxRam, 0, SpringLayout.SOUTH, serverTypes);
|
||||
sl_panel_3.putConstraint(SpringLayout.EAST, lblMaxRam, 50, SpringLayout.WEST, lblMaxRam);
|
||||
sl_panel_3.putConstraint(SpringLayout.WEST, lblMaxRam, 6, SpringLayout.EAST, serverTypes);
|
||||
panel.add(lblMaxRam);
|
||||
|
||||
maxRam = new JComboBox<>(Server.getRamList());
|
||||
sl_panel_3.putConstraint(SpringLayout.NORTH, maxRam, 10, SpringLayout.NORTH, panel);
|
||||
sl_panel_3.putConstraint(SpringLayout.NORTH, maxRam, 0, SpringLayout.NORTH, serverTypes);
|
||||
sl_panel_3.putConstraint(SpringLayout.WEST, maxRam, 6, SpringLayout.EAST, lblMaxRam);
|
||||
sl_panel_3.putConstraint(SpringLayout.EAST, maxRam, -10, SpringLayout.EAST, panel);
|
||||
panel.add(maxRam);
|
||||
maxRam.addActionListener(this);
|
||||
|
||||
chckbxEnabled = new JCheckBox("Enabled");
|
||||
sl_panel_3.putConstraint(SpringLayout.NORTH, chckbxEnabled, 6, SpringLayout.SOUTH, lblServerVersion);
|
||||
sl_panel_3.putConstraint(SpringLayout.EAST, chckbxEnabled, 0, SpringLayout.EAST, lblServerType);
|
||||
sl_panel_3.putConstraint(SpringLayout.WEST, chckbxEnabled, 10, SpringLayout.WEST, panel);
|
||||
panel.add(chckbxEnabled);
|
||||
chckbxEnabled.addActionListener(this);
|
||||
|
||||
@ -81,13 +83,15 @@ public class ServerTab implements ActionListener {
|
||||
btnRemoveServer.addActionListener(this);
|
||||
|
||||
JLabel lblDirectory = new JLabel("Directory");
|
||||
sl_panel_3.putConstraint(SpringLayout.NORTH, lblDirectory, 1, SpringLayout.NORTH, chckbxEnabled);
|
||||
sl_panel_3.putConstraint(SpringLayout.SOUTH, lblDirectory, 0, SpringLayout.SOUTH, chckbxEnabled);
|
||||
sl_panel_3.putConstraint(SpringLayout.WEST, lblDirectory, 6, SpringLayout.EAST, chckbxEnabled);
|
||||
panel.add(lblDirectory);
|
||||
|
||||
directory = new JTextField();
|
||||
sl_panel_3.putConstraint(SpringLayout.WEST, directory, 6, SpringLayout.EAST, lblDirectory);
|
||||
sl_panel_3.putConstraint(SpringLayout.SOUTH, lblDirectory, 0, SpringLayout.SOUTH, directory);
|
||||
sl_panel_3.putConstraint(SpringLayout.NORTH, lblDirectory, 0, SpringLayout.NORTH, directory);
|
||||
sl_panel_3.putConstraint(SpringLayout.NORTH, chckbxEnabled, 0, SpringLayout.NORTH, directory);
|
||||
sl_panel_3.putConstraint(SpringLayout.SOUTH, chckbxEnabled, 0, SpringLayout.SOUTH, directory);
|
||||
panel.add(directory);
|
||||
directory.setColumns(10);
|
||||
directory.addActionListener(this);
|
||||
|
Loading…
Reference in New Issue
Block a user