diff options
Diffstat (limited to 'javax/swing/plaf/basic/BasicButtonListener.java')
-rw-r--r-- | javax/swing/plaf/basic/BasicButtonListener.java | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/javax/swing/plaf/basic/BasicButtonListener.java b/javax/swing/plaf/basic/BasicButtonListener.java index 848958215..042192b62 100644 --- a/javax/swing/plaf/basic/BasicButtonListener.java +++ b/javax/swing/plaf/basic/BasicButtonListener.java @@ -73,12 +73,12 @@ public class BasicButtonListener implements MouseListener, MouseMotionListener, // Store the TextLayout for this in a client property for speed-up // painting of the label. String property = e.getPropertyName(); + AbstractButton b = (AbstractButton) e.getSource(); if ((property.equals(AbstractButton.TEXT_CHANGED_PROPERTY) || property.equals("font")) && SystemProperties.getProperty("gnu.javax.swing.noGraphics2D") == null) { - AbstractButton b = (AbstractButton) e.getSource(); String text = b.getText(); if (text == null) text = ""; @@ -87,6 +87,10 @@ public class BasicButtonListener implements MouseListener, MouseMotionListener, TextLayout layout = new TextLayout(text, b.getFont(), frc); b.putClientProperty(BasicGraphicsUtils.CACHED_TEXT_LAYOUT, layout); } + if (property.equals(AbstractButton.TEXT_CHANGED_PROPERTY)) + { + BasicHTML.updateRenderer(b, b.getText()); + } } protected void checkOpacity(AbstractButton b) |