Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Problem with fullscreen

 
Derek Boring
Ranch Hand
Posts: 65
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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?
 
Derek Boring
Ranch Hand
Posts: 65
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 65
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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!
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic