39 lines
1.0 KiB
Java
39 lines
1.0 KiB
Java
package net.knarcraft.serverlauncher.userinterface;
|
|
|
|
import javax.swing.JFrame;
|
|
import javax.swing.JTabbedPane;
|
|
import java.awt.BorderLayout;
|
|
|
|
/**
|
|
* A parent window for server consoles.
|
|
* Should be toggled with the "View server consoles" button.
|
|
* Keeps track of all consoles.
|
|
*
|
|
* @author Kristian Knarvik <kristian.knarvik@knett.no>
|
|
* @version 1.0.0
|
|
* @since 1.0.0
|
|
*/
|
|
public class ServerConsoles {
|
|
private static JFrame frame;
|
|
private static JTabbedPane consolesTab;
|
|
|
|
public ServerConsoles() {
|
|
frame = new JFrame();
|
|
frame.setBounds(100, 100, 450, 300);
|
|
frame.setDefaultCloseOperation(JFrame.HIDE_ON_CLOSE);
|
|
consolesTab = new JTabbedPane(JTabbedPane.TOP);
|
|
frame.getContentPane().add(consolesTab, BorderLayout.CENTER);
|
|
}
|
|
|
|
public static Console addTab(String name) {
|
|
return new Console(consolesTab, name);
|
|
}
|
|
|
|
public static void show() {
|
|
frame.setVisible(true);
|
|
}
|
|
|
|
public static JTabbedPane getTab() {
|
|
return consolesTab;
|
|
}
|
|
} |