< prev index next >
src/java.desktop/unix/classes/sun/awt/X11/XWindowPeer.java
Print this page
@@ -171,30 +171,18 @@
} finally {
SunToolkit.awtUnlock();
}
cachedFocusableWindow = isFocusableWindow();
-
- Font f = target.getFont();
- if (f == null) {
- f = XWindow.getDefaultFont();
- target.setFont(f);
- // we should not call setFont because it will call a repaint
- // which the peer may not be ready to do yet.
- }
- Color c = target.getBackground();
- if (c == null) {
- Color background = SystemColor.window;
- target.setBackground(background);
- // we should not call setBackGround because it will call a repaint
- // which the peer may not be ready to do yet.
+ if (!target.isBackgroundSet()) {
+ target.setBackground(SystemColor.window);
}
- c = target.getForeground();
- if (c == null) {
+ if (!target.isForegroundSet()) {
target.setForeground(SystemColor.windowText);
- // we should not call setForeGround because it will call a repaint
- // which the peer may not be ready to do yet.
+ }
+ if (!target.isFontSet()) {
+ target.setFont(XWindow.getDefaultFont());
}
alwaysOnTop = ((Window)target).isAlwaysOnTop() && ((Window)target).isAlwaysOnTopSupported();
GraphicsConfiguration gc = getGraphicsConfiguration();
< prev index next >