Take the 2-minute tour ×
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

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?

share|improve this question
    
Google Java full screen application. I believe it still uses a J Frame but in full screen mode. –  Brendan Sep 15 '12 at 16:30
add comment

2 Answers

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

// Set fullscreen mode with specified resolution
GraphicsDevice device = GraphicsEnvironment.getLocalGraphicsEnvironment().getDefaultScreenDevice();
device.setFullScreenWindow(frame);
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.

share|improve this answer
add comment

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

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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