Search code examples
javamacosjinternalframe

JInternalFrame Does Not Fully Maximize Under Mac OS X


I'm working with JInternalFrame's under Mac OS X Java 5 and when maximizing a JInternalFrame within a JDesktopPane the window doesn't fully maximize, but the property to allow maximizing is definitely set to true. This is the result I'm getting when maximized:

Seeing as though the image previews didn't work.

I've got no idea why it's happening. Here's my code.

    JInternalFrame f = new JInternalFrame("irc.quakenet.org - #overclockers", true, true, true, true);
    f.setVisible(true);
    f.setSize(300,300);
    f.setEnabled(true);
    f.setMaximizable(true);
    try {
        f.setSelected(true);
    } catch (PropertyVetoException e) {
        e.printStackTrace();
    }

Any ideas?


Solution

  • Swing may be respecting the fact that you can't fully maximize a window on the Mac. As in, if you maximize a real window, it will simply become big, but not fill the entire screen. The desktop pane may be emulating this behaviour.

    You may be able to override this by listening for maximize events and manually setting the window bounds to precisely fill the desktop pane.