This sets the bg color of the content pane of a JInternalFrame to null
at UI install time, and only if there is no custom color already set.
This fixes bug#27481 and causes no regressions AFAICS.

2006-05-10  Roman Kennke <[EMAIL PROTECTED]>

        PR 27481
        * javax/swing/plaf/basic/BasicInternalFrameUI.java
        (installDefaults): Set background of content pane to null, if
        no custom color has been installed by the application yet.

/Roman
Index: javax/swing/plaf/basic/BasicInternalFrameUI.java
===================================================================
RCS file: /cvsroot/classpath/classpath/javax/swing/plaf/basic/BasicInternalFrameUI.java,v
retrieving revision 1.32
diff -u -r1.32 BasicInternalFrameUI.java
--- javax/swing/plaf/basic/BasicInternalFrameUI.java	17 Apr 2006 07:41:05 -0000	1.32
+++ javax/swing/plaf/basic/BasicInternalFrameUI.java	10 May 2006 21:15:38 -0000
@@ -1205,6 +1205,15 @@
       frame.setLayout(internalFrameLayout);
       LookAndFeel.installBorder(frame, "InternalFrame.border");
       frame.setFrameIcon(UIManager.getIcon("InternalFrame.icon"));
+
+      // Let the content pane inherit the background color from its
+      // frame by setting the background to null.
+      Component contentPane = frame.getContentPane();
+      if (contentPane != null
+          && contentPane.getBackground() instanceof UIResource)
+        {
+          contentPane.setBackground(null);
+        }
   }
 
   /**

Reply via email to