frame.setExtendedState(JFrame.MAXIMIZED_BOTH);
GraphicsEnvironment graphics = GraphicsEnvironment.getLocalGraphicsEnvironment(); GraphicsDevice device = graphics.getDefaultScreenDevice(); JFrame frame = new JFrame("Fullscreen"); device.setFullScreenWindow(frame);