wood burning stoves 2.0*
The moose likes Swing / AWT / SWT and the fly likes Problem with fullscreen Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "Problem with fullscreen" Watch "Problem with fullscreen" New topic
Author

Problem with fullscreen

Derek Boring
Ranch Hand

Joined: Aug 15, 2006
Posts: 63
I'm making a game and I want the player to be able to switch between full screen and windowed mode. Here's the code I'm using for the switch:

The problem is that it still draws the window decorations. I can't figue out how to stop it from doing that. Can anyone help me?


Life is 10% what happens and 90% how you react to it.
Attitude is everything.
Derek Boring
Ranch Hand

Joined: Aug 15, 2006
Posts: 63
My apologies, I did not see the thread posted by Devasia Manuel concerning a similar problem. I will try the method proposed there and post again if it works or not.
Derek Boring
Ranch Hand

Joined: Aug 15, 2006
Posts: 63
It worked. My game was already all on a JPanel thanks to a suggestion from Ernest Friedman-Hill to make the graphics not glitch, so the conversion was very easy. I just modified my JPanel so that when the player presses the full screen button, it disposes the current frame and creates a new one that is either undecorated or decorated depending on if it's going to fullscreen or windowed mode, respectively. Then I had my JPanel add itself to the new JFrame, execute the code to make it full screen or go back to windowed, and there it is!

PS. Sorry about not looking well enough before I asked. Thanks for your patience guys!
 
 
subject: Problem with fullscreen
 
Similar Threads
Drawing An Image In Full-Screen
JOptionPane buttons don't seem to work.
Question about Exclusive Full Screen mode
Switching between fullscreen and windowed
Developing Games In Java chapter 2 example not doing as i would have expected