Skip to Main Content

Java SE (Java Platform, Standard Edition)

Announcement

For appeals, questions and feedback, please email oracle-forums_moderators_us@oracle.com

Mac:Window shrinks into the corner when maximized on OSX 10.8

998861Mar 24 2013
Hello,

My application creates a Frame like this:

Frame foo = new Frame();
Rectangle bounds = new Rectangle(0, 0, WIDTH, HEIGHT);
foo.setBounds(bounds);
foo.setExtendedState(Frame.MAXIMIZED_BOTH);
foo.setVisible(true);

If the WIDTH and HEIGHT are the full dimensions of the screen, or the maximum allowed after accounting for toolkit insets, then setExtendedState(Frame.MAXIMIZED_BOTH) causes the window to shrink to the smallest possible size down in the lower-left corner of the screen.

If I omit the setExtendedState() call, then the window is full-sized.

If I include setExtendedState(), but initialize the bounds to something smaller (e.g. 640x480), the window appears and then maximizes as expected.

Has anyone else seen this behavior? This seems to occur ONLY on Mac OS X (my system is 10.8.3, JDK 1.7u17). On Windows, I always get a maximized window as expected.

Thanks!
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Apr 21 2013
Added on Mar 24 2013
0 comments
1,026 views