1

On Mac OS X with the native Aqua Look and Feel, JInternalFrames have a shadow that is part of the frame border. When the internal frame is maximized, the shadow is still visible and takes a lot of space.

Is there a way to remove this shadow without switching to another look and feel?

Emmanuel Bourg
  • 9,601
  • 3
  • 48
  • 76

2 Answers2

3

After digging into the Aqua L&F code in OpenJDK I found an undocumented property that let you change the style of an internal frame. Shadows can be removed with this:

internalFrame.putClientProperty("JInternalFrame.frameType", "normal");

http://hg.openjdk.java.net/macosx-port/macosx-port/jdk/file/087d8f180711/src/macosx/classes/com/apple/laf/AquaInternalFrameUI.java

Emmanuel Bourg
  • 9,601
  • 3
  • 48
  • 76
1

Swing makes it relatively easy to create your own Border classes. The Swing set does that by providing a base class named AbstractBorder. The AbstractBorder class can be a good starting point for creating customized borders for Swing components.

you can easily override the installation of a UI-default border for the component by simply setting your own Border object using the setBorder() method.

For more details see this : Understanding borders

COD3BOY
  • 11,964
  • 1
  • 38
  • 56
  • Thank you for the suggestion, but that would remove the whole border. If possible I'd like to remove just the shadow and preserve the style of the frame border. Writing a custom border is unlikely to look like the native one. – Emmanuel Bourg Oct 20 '11 at 17:10
  • I'm not sure if thats possible! Hope someone else will answer :)) – COD3BOY Oct 21 '11 at 01:35