Skip to Main Content

Java SE (Java Platform, Standard Edition)

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

JFrame (extended) state, iconified/maximized/normal question

JosAHMar 6 2005 — edited Aug 23 2005
Greetings and salutations,

I've been removing some rough edges from my last application and I noticed the
following: before an application quits every location/size of the top level components
is written to a file. When the application starts again everything is read back in
again and the application shows itself just as it was before it closed the last time.

There's one little quirck though:

A JFrame can be in one of three states when an application quits:

1) iconified; nothing is wrong here, i.e. the application comes back on in the same
iconified state and after de-iconification the JFrame shows up the same as
before the previous quiting.

2) 'normal': same as above: the JFrame shows up identical as before quiting
the application the previous time.

3) maximized: the new incarnation shows up as a maximized JFrame, but after
'demaximalization' (sorry) the JFrame keeps its maximum size, i.e. if still fills up
the entire screen.

Before quiting I save the bounds, the state and the extended state of a JFrame
and reinstate these values after a new incarnation of the application. I think I've
tried all 2^3 == 8 possible permutations of this all, but option 3) keeps giving
me trouble, i.e. the bounds don't work after 'demaximalization'.

Ideas anyone?

kind regards,

Jos
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Sep 20 2005
Added on Mar 6 2005
14 comments
1,200 views