--- old/src/java.desktop/windows/classes/sun/awt/windows/WPanelPeer.java 2016-05-17 16:12:39.229515000 +0530 +++ new/src/java.desktop/windows/classes/sun/awt/windows/WPanelPeer.java 2016-05-17 16:12:39.041420999 +0530 @@ -1,5 +1,5 @@ /* - * 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 @@ -79,18 +79,18 @@ 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); } + } /**