• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Maximizing JFrame

 
Gregg Bolinger
Ranch Hand
Posts: 15304
6
Chrome IntelliJ IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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?
 
Nathan Pruett
Bartender
Posts: 4121
IntelliJ IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Gregg Bolinger
Ranch Hand
Posts: 15304
6
Chrome IntelliJ IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 57
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
no method gives this feature until JDK1.3.
but JDK 1.4 has a method, setExtendedState() which can satisfy your requirement
 
Gregg Bolinger
Ranch Hand
Posts: 15304
6
Chrome IntelliJ IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 49
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Have you tried addWindowListener. It has methods that allow you to use all types of Window Listener items.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic