File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Swing / AWT / SWT and the fly likes Maximizing JFrame Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "Maximizing JFrame" Watch "Maximizing JFrame" New topic

Maximizing JFrame

Narayanan Jayaraman
Ranch Hand

Joined: Apr 09, 2003
Posts: 52
How maiximze the Jframe size ?. Like dobule clicking maximize application windows to screen size , is it possible to set jframe size to screen size ?. Thanks
Gregg Bolinger
GenRocket Founder
Ranch Hand

Joined: Jul 11, 2001
Posts: 15302

Look at the setExtendableState method of JFrame in JDK1.4 or greater.

GenRocket - Experts at Building Test Data
Narayanan Jayaraman
Ranch Hand

Joined: Apr 09, 2003
Posts: 52
Is it possible in JDK 1.3 ?
Nathan Pruett

Joined: Oct 18, 2000
Posts: 4121

You can do something like :

This just makes the frame the size of the screen, it doesn't set the state to 'maximized', though (i.e. the maximize button on the frame doesn't change...). You can only do that in 1.4+.

Write once, run anywhere, because there's nowhere to hide! - /. A.C.
I agree. Here's the link:
subject: Maximizing JFrame
It's not a secret anymore!