Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JFrame maximize not really maximized

 
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 is setBounds(0, 0, screen.width, screen.height);
So that it makes it "maximized" and even though it is the full size of the screen, it isn't truly Maximized. You can still click the maximize button and it will dock the window to the screen. Is there a way to do this on load? Could you envoke the Robot class to push this button and if so, what would the call be?
Thanks

------------------
Happy Coding,
Gregg Bolinger
 
John Smith
Ranch Hand
Posts: 84
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you're using 1.4, you could do it like this:
myFrame.setExtendedState(Frame.MAXIMIZED_BOTH);
I don't think you can do this with earlier versions...
Randy
 
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 Randy!!! Too bad I am not using 1.4 I guess when it goes out of BETA I probably will.
Thanks again!!

------------------
Happy Coding,
Gregg Bolinger
 
John Smith
Ranch Hand
Posts: 84
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I don't know your situation, but I've been using 1.4 BETA for the past couple of months and haven't had any problems. It is quite stable...
Randy
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic