wood burning stoves 2.0*
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


Win a copy of OCM Java EE 6 Enterprise Architect Exam Guide this week in the OCMJEA forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "Maximizing JFrame" Watch "Maximizing JFrame" New topic
Author

Maximizing JFrame

Gregg Bolinger
GenRocket Founder
Ranch Hand

Joined: Jul 11, 2001
Posts: 15299
    
    6

I have a JFrame that needs to be maximized. Right now, I use Deminsion to get the screen size and then setbounds to the screen size, but it is really not maximized. Is there a command or method to actually maximize the window on load?


GenRocket - Experts at Building Test Data
Nathan Pruett
Bartender

Joined: Oct 18, 2000
Posts: 4121

What do you mean "it is really not maximized"? The only way I have ever made a Frame take up the whole screen is by doing a getScreenSize with Toolkit and then setBounds on the Frame using those dimensions... Can you be more specific with what you don't like about the results you get from this?

-Nate


-Nate
Write once, run anywhere, because there's nowhere to hide! - /. A.C.
Gregg Bolinger
GenRocket Founder
Ranch Hand

Joined: Jul 11, 2001
Posts: 15299
    
    6

What I mean, is, you can still click the maximize Icon, and it docks the window to the maximum. When you make it as big as the screen, it really isn't maximized.
Swamy Vatti
Ranch Hand

Joined: May 02, 2001
Posts: 57
no method gives this feature until JDK1.3.
but JDK 1.4 has a method, setExtendedState() which can satisfy your requirement

Swamy
Gregg Bolinger
GenRocket Founder
Ranch Hand

Joined: Jul 11, 2001
Posts: 15299
    
    6

Thanks, but I think I'll wait for a while to jump on board with 1.4. I have found some kinks in it since it is just BETA, but thanks for the response
keiyia jackson
Ranch Hand

Joined: Jul 16, 2001
Posts: 49
Have you tried addWindowListener. It has methods that allow you to use all types of Window Listener items.
 
 
subject: Maximizing JFrame