summaryrefslogtreecommitdiff
path: root/javax/swing/text/LabelView.java
diff options
context:
space:
mode:
Diffstat (limited to 'javax/swing/text/LabelView.java')
-rw-r--r--javax/swing/text/LabelView.java6
1 files changed, 5 insertions, 1 deletions
diff --git a/javax/swing/text/LabelView.java b/javax/swing/text/LabelView.java
index 4890735b9..03279c4b2 100644
--- a/javax/swing/text/LabelView.java
+++ b/javax/swing/text/LabelView.java
@@ -109,7 +109,11 @@ public class LabelView extends GlyphView
{
Element el = getElement();
AttributeSet atts = el.getAttributes();
- background = StyleConstants.getBackground(atts);
+ // We cannot use StyleConstants.getBackground() here, because that returns
+ // BLACK as default (when background == null). What we need is the
+ // background setting of the text component instead, which is what we get
+ // when background == null anyway.
+ background = (Color) atts.getAttribute(StyleConstants.Background);
foreground = StyleConstants.getForeground(atts);
strikeThrough = StyleConstants.isStrikeThrough(atts);
subscript = StyleConstants.isSubscript(atts);