1 package eu.svjatoslav.instantlauncher;
3 import eu.svjatoslav.instantlauncher.menu.MultiLevelMenu;
7 import java.awt.event.WindowEvent;
8 import java.awt.event.WindowListener;
12 public static final Dimension CONTENT_PANEL_SIZE = new Dimension(1100, 850);
13 private final InstantLauncher instantLauncher;
15 private boolean isShowing;
17 public MainFrame(final InstantLauncher instantLauncher) {
18 this.instantLauncher = instantLauncher;
21 private void buildContentPane() {
23 final MultiLevelMenu multiLevelMenu = new MultiLevelMenu(instantLauncher);
24 frame.getContentPane().add(multiLevelMenu.buildContentPanel(), BorderLayout.CENTER);
32 frame = new JFrame("InstantLauncher");
36 // registor window listener
37 final FrameWindowListener windowListener = new FrameWindowListener();
38 frame.addWindowListener(windowListener);
41 frame.setExtendedState(JFrame.MAXIMIZED_BOTH);
42 frame.setVisible(true);
49 private static class FrameWindowListener implements WindowListener {
52 public void windowActivated(final WindowEvent e) {
56 public void windowClosed(final WindowEvent e) {
60 public void windowClosing(final WindowEvent e) {
61 InstantLauncher.exitProgram();
65 public void windowDeactivated(final WindowEvent e) {
69 public void windowDeiconified(final WindowEvent e) {
73 public void windowIconified(final WindowEvent e) {
77 public void windowOpened(final WindowEvent e) {