File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Java in General and the fly likes window maximize/restore events Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Bookmark "window maximize/restore events" Watch "window maximize/restore events" New topic

window maximize/restore events

shar ball

Joined: Jul 14, 2005
Posts: 6
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?
KArol Muszynski
Ranch Hand

Joined: Aug 09, 2005
Posts: 45
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.

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

Best Regards,
KArol Muszynski
I agree. Here's the link:
subject: window maximize/restore events
It's not a secret anymore!