• 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

Maximizing a Frame

 
Ranch Hand
Posts: 296
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I'd like to create the effect that occurs when you click on the "Maximize" Button on Windows OS. (ie. the middle button in the top right corner)
I can use Toolkit.getDefaultToolkit().getScreenSize();
and then resize the Window, but it's not the same.
I've tried generating the event with the processEvent and dispatchEvent methods, but I can only get it to work for a WINDOW_CLOSING event.
I noticed that when I click on the Maximize button, it generates a WINDOW_DEACTIVATED event in Java. But if I try to send this event, it does nothing?
How else can I do this?
Thanks,
Drew
 
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
JDK 1.4 added the setExtendedState( int ) method to the Frame class. The int value to send to it is Frame.MAXIMIZED_BOTH to maximize the Frame.
 
Drew Lane
Ranch Hand
Posts: 296
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks, but I'm stuck using JDK 1.1 for this.
Drew
 
reply
    Bookmark Topic Watch Topic
  • New Topic