I am working on an arcade-like game, and so far, I have been using JFrame. All the action occurs in the JFrame basically.

However, I've noticed that a lot of games that you install on a computer don't have a frame. When you play them on Windows, the game covers the entire screen (the start bar disappears and you can't access any other application on your computer).

I'd like to do that for my game. Is it possible to do so with Java? If so, how would I do this?

  • \$\begingroup\$ Google Java full screen application. I believe it still uses a J Frame but in full screen mode. \$\endgroup\$ – Brendan Lesniak Sep 15 '12 at 16:30

You can set JFrame to fullscreen with GraphicsDevice.setFullScreenWindow(jframe);. For example:

// Set fullscreen mode with specified resolution
GraphicsDevice device = GraphicsEnvironment.getLocalGraphicsEnvironment().getDefaultScreenDevice();
device.setDisplayMode(new DisplayMode(1280, 720, 32, 60)); // 1280x720 32bpp @ 60Hz

Alternatively when you are using OpenGL, both JOGL and LWJGL have their own native window implementations for rendering. With these you don't need JFrame at all.


You can use an engine like jmonkeyengine. It made with Java and OpenGL


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.