import java.awt.BorderLayout;
import java.awt.Dimension;
-import java.awt.Point;
import java.awt.event.WindowEvent;
import java.awt.event.WindowListener;
public class MainFrame {
- public static class FrameWindowListener implements WindowListener {
-
- @Override
- public void windowActivated(final WindowEvent e) {
- }
-
- @Override
- public void windowClosed(final WindowEvent e) {
- }
-
- @Override
- public void windowClosing(final WindowEvent e) {
- InstantLauncher.exitProgram();
- }
-
- @Override
- public void windowDeactivated(final WindowEvent e) {
- }
-
- @Override
- public void windowDeiconified(final WindowEvent e) {
- }
-
- @Override
- public void windowIconified(final WindowEvent e) {
- }
-
- @Override
- public void windowOpened(final WindowEvent e) {
- }
-
- }
-
private JFrame frame;
private boolean isShowing;
public static final Dimension CONTENT_PANEL_SIZE = new Dimension(1100, 850);
- public static final Point INITIAL_LOCATION = new Point(100, 30);
private final InstantLauncher instantLauncher;
buildContentPane();
- frame.setSize(CONTENT_PANEL_SIZE);
- frame.setVisible(true);
- frame.setLocation(INITIAL_LOCATION);
-
// registor window listener
final FrameWindowListener windowListener = new FrameWindowListener();
frame.addWindowListener(windowListener);
// maximize window
frame.setExtendedState(JFrame.MAXIMIZED_BOTH);
+ frame.setVisible(true);
isShowing = true;
}
}
+ public static class FrameWindowListener implements WindowListener {
+
+ @Override
+ public void windowActivated(final WindowEvent e) {
+ }
+
+ @Override
+ public void windowClosed(final WindowEvent e) {
+ }
+
+ @Override
+ public void windowClosing(final WindowEvent e) {
+ InstantLauncher.exitProgram();
+ }
+
+ @Override
+ public void windowDeactivated(final WindowEvent e) {
+ }
+
+ @Override
+ public void windowDeiconified(final WindowEvent e) {
+ }
+
+ @Override
+ public void windowIconified(final WindowEvent e) {
+ }
+
+ @Override
+ public void windowOpened(final WindowEvent e) {
+ }
+
+ }
+
}