diff --git a/src/main/java/de/ph87/kindermalen/Window.java b/src/main/java/de/ph87/kindermalen/Window.java index 084b857..c050988 100644 --- a/src/main/java/de/ph87/kindermalen/Window.java +++ b/src/main/java/de/ph87/kindermalen/Window.java @@ -13,8 +13,6 @@ import static de.ph87.kindermalen.util.MyGridBagConstraints.C; public class Window extends JFrame { - public static final int SCREEN = 1; - private final Drawing drawing = new Drawing(1920, 1080); public static void main(String[] args) { @@ -34,7 +32,7 @@ public class Window extends JFrame { pack(); - setFullscreen(); + setExtendedState(getExtendedState() | MAXIMIZED_BOTH); setDefaultCloseOperation(EXIT_ON_CLOSE); KeyboardFocusManager.getCurrentKeyboardFocusManager() @@ -55,19 +53,4 @@ public class Window extends JFrame { ); } - private void setFullscreen() { - final GraphicsEnvironment graphicsEnvironment = GraphicsEnvironment.getLocalGraphicsEnvironment(); - final GraphicsDevice[] graphicsDevices = graphicsEnvironment.getScreenDevices(); - final GraphicsDevice graphicsDevice; - if (SCREEN < graphicsDevices.length) { - graphicsDevice = graphicsDevices[SCREEN]; - } else if (graphicsDevices.length > 0) { - graphicsDevice = graphicsDevices[0]; - } else { - throw new RuntimeException("No Screens Found"); - } - graphicsDevice.setFullScreenWindow(this); -// setPreferredSize(new Dimension(graphicsDevice.getDisplayMode().getWidth(),graphicsDevice.getDisplayMode().getHeight())); - } - }