Created
August 17, 2013 21:57
-
-
Save kelliott121/6258873 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package its.view; | |
import javax.swing.JFrame; | |
import javax.swing.JScrollPane; | |
import javax.swing.JSplitPane; | |
public class GUIWindow extends JFrame{ | |
private static final long serialVersionUID = 4159491956760989038L; | |
private static final double VERSION = 0.1; | |
private JSplitPane sidebarScreenSplitPane; | |
private JSplitPane screenConsoleSplitPane; | |
private SideBar sidebar; | |
private MainScreen screen; | |
private Console console; | |
GUIWindow(){ | |
super("Into the Sky v" + VERSION); | |
this.setDefaultCloseOperation(EXIT_ON_CLOSE); | |
//Create the sidebar | |
sidebar = new SideBar(); | |
//Create the main screen | |
screen = new MainScreen(); | |
//Create the console window | |
console = new Console(); | |
//Add the screen and chat to the screen-console splitpane | |
screenConsoleSplitPane = new JSplitPane(JSplitPane.VERTICAL_SPLIT, new JScrollPane(screen), new JScrollPane(console)); | |
//Add everything to the sidebar-screen splitpane | |
sidebarScreenSplitPane = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, sidebar, screenConsoleSplitPane); | |
this.add(sidebarScreenSplitPane); | |
screen.setView(); | |
this.setSize(1000, 700); | |
this.setLocation(0, 20); | |
this.setVisible(true); | |
//Move the divider so the screen takes up the majority of the space | |
screenConsoleSplitPane.setDividerLocation(.85); | |
//Move the divider so it gives enough space to the different tabs | |
sidebarScreenSplitPane.setDividerLocation(.25); | |
console.print("GUI Loaded"); | |
} | |
public static void main(String args[]){ | |
new GUIWindow(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment