Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / July 2006

Tip: Looking for answers? Try searching our database.

problem maximizing a frame

Thread view: 
hilz - 05 Jul 2006 19:12 GMT
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.
Andrew T. - 05 Jul 2006 19:38 GMT
> 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.
hilz - 05 Jul 2006 20:11 GMT
>> Hi
>> I am trying to maximize a JFrame, but it does not work.
[quoted text clipped - 11 lines]
>
> 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.


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.