views:

418

answers:

2

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?

+1  A: 

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.

Zarkonnen
A: 

True indeed, Mac OS doesn't fully maximize windows. The problem is that I won't achieve the effect of a 'docked' window by just setting the size of the active window, which means a different approach is most probably required. That seems to be a common approach to the problem though.

Kezzer