summaryrefslogtreecommitdiffstats
path: root/src/subconscious/graphics/GameWindow.java
diff options
context:
space:
mode:
authorNao Pross <naopross@thearcway.org>2018-11-24 17:25:43 +0100
committerNao Pross <naopross@thearcway.org>2018-11-24 17:25:43 +0100
commit5fa247e24b58a01ade89bc2a1a8fb4036e7de764 (patch)
treea0f7ccb99acbe69498fdf8c64d3137fc431eb574 /src/subconscious/graphics/GameWindow.java
parentUpdate MapScene size members on window resize (diff)
downloadSubconscious-java-5fa247e24b58a01ade89bc2a1a8fb4036e7de764.tar.gz
Subconscious-java-5fa247e24b58a01ade89bc2a1a8fb4036e7de764.zip
Remove Swing dependency
We can build everything on top of AWT
Diffstat (limited to 'src/subconscious/graphics/GameWindow.java')
-rw-r--r--src/subconscious/graphics/GameWindow.java14
1 files changed, 6 insertions, 8 deletions
diff --git a/src/subconscious/graphics/GameWindow.java b/src/subconscious/graphics/GameWindow.java
index 65af798..f444a6a 100644
--- a/src/subconscious/graphics/GameWindow.java
+++ b/src/subconscious/graphics/GameWindow.java
@@ -8,10 +8,8 @@ import java.util.AbstractMap.SimpleEntry;
import java.awt.Dimension;
import java.awt.CardLayout;
import java.awt.BorderLayout;
-
-import javax.swing.JFrame;
-import javax.swing.JPanel;
-import javax.swing.JButton;
+import java.awt.Frame;
+import java.awt.Panel;
import java.awt.event.WindowListener;
import java.awt.event.WindowEvent;
@@ -21,10 +19,10 @@ import java.awt.event.WindowEvent;
* unloading scenes, and the window itself
*/
@SuppressWarnings("serial")
-public class GameWindow extends JFrame implements WindowListener {
+public class GameWindow extends Frame implements WindowListener {
public static final Dimension WINDOW_SIZE = new Dimension(600, 400);
- private JPanel root;
+ private Panel root;
// reference to the current scene which is NOT on the stack
private Scene scene = null;
@@ -41,7 +39,7 @@ public class GameWindow extends JFrame implements WindowListener {
this.game = g;
// set up JFrame
- this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
+ // this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
this.setSize(WINDOW_SIZE);
this.setPreferredSize(WINDOW_SIZE);
this.setLocationRelativeTo(null);
@@ -50,7 +48,7 @@ public class GameWindow extends JFrame implements WindowListener {
// set up components
// set up a cardlayout
- this.root = new JPanel(new CardLayout());
+ this.root = new Panel(new CardLayout());
this.add(this.root, BorderLayout.CENTER);
this.pack();