problem maximizing a frame

H

hilz

Hi
I am trying to maximize a JFrame, but it does not work.
Any help is greatly appreciated.

I call this:

Toolkit.getDefaultToolkit().isFrameStateSupported(Frame.MAXIMIZED_BOTH)

and it returns true. So this means it should work.
So now i call this:

this.setExtendedState(Frame.MAXIMIZED_BOTH);


but this does not seem to work. I tried to call it before and after
setVisible(true) and it still won't work.

If anyone knows what the problem is, please let me know.
Thanks.
 
A

Andrew T.

hilz said:
Hi
I am trying to maximize a JFrame, but it does not work. ....
this.setExtendedState(Frame.MAXIMIZED_BOTH);

but this does not seem to work.

Works for me in the nearest frame I have to hand
(the Saverbeans ScreensaverFrame).
If anyone knows what the problem is, please let me know.

I'd say it is something in the rest of the code (shrugs)..

Andrew T.
 
H

hilz

Andrew said:
Works for me in the nearest frame I have to hand
(the Saverbeans ScreensaverFrame).


I'd say it is something in the rest of the code (shrugs)..

Andrew T.


You're right!
It actually was in the rest of the code!
There was a setVisible() being called after my setExtendedState call,
and i didn't see that one at the beginning.
Once moved setExtendedState to a place after the last setVisible... it
worked like a charm!

thanks for your help.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top