Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to set Jframe to full screen

 
Koh Khai Huat
Ranch Hand
Posts: 100
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi guys does anyone know how to set the jframe to full screen

if u knoe pls reply me asap thank you
very much for yr help

regards,
khai huat
 
Stephen Boston
Ranch Hand
Posts: 165
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How's this?
 
Manuel Moons
Ranch Hand
Posts: 229
  • Likes 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Actually if you really want your frame to become maximized you should use the following method:



If you do not want the frame to show decorations anymore (and really go fullscreen) you can:



Hope this helps...
 
Stephen Boston
Ranch Hand
Posts: 165
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I must admit that is much shorter than mine.
 
Manuel Moons
Ranch Hand
Posts: 229
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes it is a bit shorter but that is not the only advantage. The setState method actually maximizes the window just like when you click on the maximize button on your window.

When calling the setSize (setBounds) methods the window never gets in the maximized state (not even when you make it as large as the screen).
 
Jeff Albertson
Ranch Hand
Posts: 1780
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You probably meant to ask how to maximize JFrame. On the other hand, if
you wanted to go into a "full screen exclusive mode", to do page flipping,
active rendering, change the screen resolution and all that, that's
in a separate part of the API: http://java.sun.com/docs/books/tutorial/extra/fullscreen/index.html
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic