2 * Instantlauncher. Author: Svjatoslav Agejenko, svjatoslav@svjatoslav.eu
3 * This project is released under Creative Commons Zero (CC0) license.
5 package eu.svjatoslav.instantlauncher;
7 import eu.svjatoslav.instantlauncher.menu.MultiLevelMenu;
11 import java.awt.event.WindowEvent;
12 import java.awt.event.WindowListener;
16 private final InstantLauncher instantLauncher;
18 private boolean isShowing;
20 public MainFrame(final InstantLauncher instantLauncher) {
21 this.instantLauncher = instantLauncher;
24 private void buildContentPane() {
26 final MultiLevelMenu multiLevelMenu = new MultiLevelMenu(instantLauncher);
27 frame.getContentPane().add(multiLevelMenu.buildContentPanel(), BorderLayout.CENTER);
35 frame = new JFrame("InstantLauncher");
39 // registor window listener
40 final FrameWindowListener windowListener = new FrameWindowListener();
41 frame.addWindowListener(windowListener);
44 frame.setExtendedState(JFrame.MAXIMIZED_BOTH);
45 frame.setVisible(true);
52 private static class FrameWindowListener implements WindowListener {
55 public void windowActivated(final WindowEvent e) {
59 public void windowClosed(final WindowEvent e) {
63 public void windowClosing(final WindowEvent e) {
64 InstantLauncher.exitProgram();
68 public void windowDeactivated(final WindowEvent e) {
72 public void windowDeiconified(final WindowEvent e) {
76 public void windowIconified(final WindowEvent e) {
80 public void windowOpened(final WindowEvent e) {