< prev index next >

src/java.desktop/windows/classes/sun/awt/windows/WPanelPeer.java

Print this page

        

@@ -1,7 +1,7 @@
 /*
- * Copyright (c) 1996, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1996, 2016, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
  * under the terms of the GNU General Public License version 2 only, as
  * published by the Free Software Foundation.  Oracle designates this

@@ -77,22 +77,22 @@
     @Override
     void initialize() {
         super.initialize();
         insets_ = new Insets(0,0,0,0);
 
-        Color c = ((Component)target).getBackground();
-        if (c == null) {
+        Color c = null;
+        if (!((Component) target).isBackgroundSet()) {
             c = WColor.getDefaultColor(WColor.WINDOW_BKGND);
-            ((Component)target).setBackground(c);
+            ((Component) target).setBackground(c);
             setBackground(c);
         }
-        c = ((Component)target).getForeground();
-        if (c == null) {
+        if (!((Component) target).isForegroundSet()) {
             c = WColor.getDefaultColor(WColor.WINDOW_TEXT);
-            ((Component)target).setForeground(c);
+            ((Component) target).setForeground(c);
             setForeground(c);
         }
+
     }
 
     /**
      * DEPRECATED:  Replaced by getInsets().
      */
< prev index next >