--- old/src/java.desktop/macosx/classes/com/apple/laf/AquaLabelUI.java 2016-03-18 19:30:28.000000000 +0400 +++ new/src/java.desktop/macosx/classes/com/apple/laf/AquaLabelUI.java 2016-03-18 19:30:28.000000000 +0400 @@ -38,6 +38,7 @@ public class AquaLabelUI extends BasicLabelUI { protected static final RecyclableSingleton aquaLabelUI = new RecyclableSingletonFromDefaultConstructor(AquaLabelUI.class); + private TextUIDrawing textUIDrawing; public static ComponentUI createUI(final JComponent c) { return aquaLabelUI.get(); @@ -53,6 +54,21 @@ super.uninstallListeners(c); } + @Override + protected void installDefaults(JLabel c) { + super.installDefaults(c); + textUIDrawing = SwingUtilities2.getTextUIDrawing(textUIDrawing); + } + + @Override + protected void uninstallDefaults(JLabel c) { + super.uninstallDefaults(c); + if (textUIDrawing != SwingUtilities2.DEFAULT_UI_TEXT_DRAWING + && textUIDrawing instanceof UIResource) { + textUIDrawing = SwingUtilities2.DEFAULT_UI_TEXT_DRAWING; + } + } + protected void paintEnabledText(final JLabel l, final Graphics g, final String s, final int textX, final int textY) { int mnemIndex = l.getDisplayedMnemonicIndex(); if (AquaMnemonicHandler.isMnemonicHidden()) { @@ -60,7 +76,7 @@ } g.setColor(l.getForeground()); - SwingUtilities2.drawStringUnderlineCharAt(l, g, s, mnemIndex, textX, textY); + textUIDrawing.drawStringUnderlineCharAt(l, g, s, mnemIndex, textX, textY); } /** @@ -81,7 +97,7 @@ // if our background is still something we set then we can use our happy background color. if (background instanceof UIResource) { g.setColor(getDisabledLabelColor(l)); - SwingUtilities2.drawStringUnderlineCharAt(l, g, s, accChar, textX, textY); + textUIDrawing.drawStringUnderlineCharAt(l, g, s, accChar, textX, textY); } else { super.paintDisabledText(l, g, s, textX, textY); }