This week's book giveaway is in the OCPJP forum.
We're giving away four copies of OCA/OCP Java SE 7 Programmer I & II Study Guide and have Kathy Sierra & Bert Bates on-line!
See this thread for details.
The moose likes Swing / AWT / SWT and the fly likes How to set Jframe to full screen Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCA/OCP Java SE 7 Programmer I & II Study Guide this week in the OCPJP forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "How to set Jframe to full screen" Watch "How to set Jframe to full screen" New topic
Author

How to set Jframe to full screen

Koh Khai Huat
Ranch Hand

Joined: Aug 05, 2005
Posts: 100
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


if (!WorkHard){
System.out.println("Fail!!!");
}
Stephen Boston
Ranch Hand

Joined: Jul 14, 2005
Posts: 165
How's this?


Steve<br /> <br />No matter where you go, there you are.<br /> <br />"My evil self is at the door, and I have no power to stop it."
Manuel Moons
Ranch Hand

Joined: Mar 05, 2002
Posts: 229
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

Joined: Jul 14, 2005
Posts: 165
I must admit that is much shorter than mine.
Manuel Moons
Ranch Hand

Joined: Mar 05, 2002
Posts: 229
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

Joined: Sep 16, 2005
Posts: 1780
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


There is no emoticon for what I am feeling!
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How to set Jframe to full screen