• 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Bear Bibeault
  • Junilu Lacar
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
Bartenders:
  • Scott Selikoff
  • Piet Souris
  • Carey Brown

window maximize/restore events

 
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a problem with the window resizing.

On page load i have resized the window to some size (say 700*575) using
window.resizeTo(700, 575);

Now, the window is not in the maximized still it shows the "restore" button on the top right.... (i.e. the bar where you have minimise, maximize, restore and close) instead of a maximise button

When I click on that button it restores to the default size and then upon second click it goes to the maximised state.

I want it to maximize in a single click.

Can anyone let me know how do we do this?
 
Ranch Hand
Posts: 45
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What kind of window are You talking about ? Is it java.awt.Window or javax.swing.JWindow or javax.swing.JFrame ? I am asking because I cannot find resizeTo() method in any of these classes ! If You mean javax.swing.JFrame.resize(), it is better not to use it because it's deprecated.

Hints:
To resize window use jFrame.setSize(100,100) method.
To maximize window use jFrame.setExtendedState(JFrame.MAXIMIZED_BOTH).

Best Regards,
KArol Muszynski
 
There's a hole in the bucket, dear Liza, dear Liza, a hole in the bucket, dear liza, a tiny ad:
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
    Bookmark Topic Watch Topic
  • New Topic