• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Why isn't this working?

 
Ranch Hand
Posts: 15304
6
Mac OS X IntelliJ IDE Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am using JDK1.4 and trying to maximize my JFrame. In JDK1.3 I used to setBounds(0, 0, screen.height, screen.width) but that didn't dock the window, just made it as big as the screen. You could still mazimize the JFrame to dock the window. With JDK1.4 you are suposed to be able to setExtendedState(JFrame.MAXIMIZE_BOTH). Below is my code and it is not working. I don't get a maximized frame.

------------------
Happy Coding,
Gregg Bolinger
[This message has been edited by Gregg Bolinger (edited October 17, 2001).]
 
Gregg Bolinger
Ranch Hand
Posts: 15304
6
Mac OS X IntelliJ IDE Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Still wondering??? Anyone know?

------------------
Happy Coding,
Gregg Bolinger
 
Bartender
Posts: 4121
IntelliJ IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I had problems with this one too... messed around with it for a long time and thought that it was broken... turns out that you have to call frame.setExtendedState( Frame.MAXIMIZED_BOTH ) after the frame has been initially set visible... not that intuitive if you want a frame to open maximized... but at least now there's a way to do it... BTW, you can use the isFrameStateSupported(int) method of Toolkit to see if a certain frame state is supported in a certain platform.

Here's a working version of your program...



-Nate
 
Gregg Bolinger
Ranch Hand
Posts: 15304
6
Mac OS X IntelliJ IDE Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks a mil Nathan!!

------------------
Happy Coding,
Gregg Bolinger
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic