diff options
Diffstat (limited to 'libjava/classpath/javax/swing/plaf/ComponentUI.java')
-rw-r--r-- | libjava/classpath/javax/swing/plaf/ComponentUI.java | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/libjava/classpath/javax/swing/plaf/ComponentUI.java b/libjava/classpath/javax/swing/plaf/ComponentUI.java index 0e7680542f7..6a736f258a2 100644 --- a/libjava/classpath/javax/swing/plaf/ComponentUI.java +++ b/libjava/classpath/javax/swing/plaf/ComponentUI.java @@ -38,8 +38,10 @@ exception statement from your version. */ package javax.swing.plaf; +import java.awt.Color; import java.awt.Dimension; import java.awt.Graphics; +import java.awt.Rectangle; import javax.accessibility.Accessible; import javax.swing.JComponent; @@ -86,6 +88,7 @@ public abstract class ComponentUI */ public ComponentUI() { + // Nothing to do here. } @@ -157,6 +160,8 @@ public abstract class ComponentUI */ public void paint(Graphics g, JComponent c) { + // Nothing is done here. This method is meant to be overridden by + // subclasses. } @@ -181,13 +186,14 @@ public abstract class ComponentUI { if (c.isOpaque()) { + Color oldColor = g.getColor(); g.setColor(c.getBackground()); g.fillRect(0, 0, c.getWidth(), c.getHeight()); + g.setColor(oldColor); } paint(g, c); } - - + /** * Determines the preferred size of a component. The default * implementation returns <code>null</code>, which means that |