< prev index next >
src/java.desktop/share/classes/javax/swing/plaf/basic/BasicLabelUI.java
Print this page
*** 127,137 ****
*/
protected void paintEnabledText(JLabel l, Graphics g, String s, int textX, int textY)
{
int mnemIndex = l.getDisplayedMnemonicIndex();
g.setColor(l.getForeground());
! SwingUtilities2.drawStringUnderlineCharAt(l, g, s, mnemIndex,
textX, textY);
}
/**
--- 127,137 ----
*/
protected void paintEnabledText(JLabel l, Graphics g, String s, int textX, int textY)
{
int mnemIndex = l.getDisplayedMnemonicIndex();
g.setColor(l.getForeground());
! getTextUIDrawing().drawStringUnderlineCharAt(l, g, s, mnemIndex,
textX, textY);
}
/**
*** 149,162 ****
protected void paintDisabledText(JLabel l, Graphics g, String s, int textX, int textY)
{
int accChar = l.getDisplayedMnemonicIndex();
Color background = l.getBackground();
g.setColor(background.brighter());
! SwingUtilities2.drawStringUnderlineCharAt(l, g, s, accChar,
textX + 1, textY + 1);
g.setColor(background.darker());
! SwingUtilities2.drawStringUnderlineCharAt(l, g, s, accChar,
textX, textY);
}
/**
* Paints the label text with the foreground color, if the label is opaque
--- 149,162 ----
protected void paintDisabledText(JLabel l, Graphics g, String s, int textX, int textY)
{
int accChar = l.getDisplayedMnemonicIndex();
Color background = l.getBackground();
g.setColor(background.brighter());
! getTextUIDrawing().drawStringUnderlineCharAt(l, g, s, accChar,
textX + 1, textY + 1);
g.setColor(background.darker());
! getTextUIDrawing().drawStringUnderlineCharAt(l, g, s, accChar,
textX, textY);
}
/**
* Paints the label text with the foreground color, if the label is opaque
*** 337,346 ****
--- 337,347 ----
return Component.BaselineResizeBehavior.OTHER;
}
public void installUI(JComponent c) {
+ super.installUI(c);
installDefaults((JLabel)c);
installComponents((JLabel)c);
installListeners((JLabel)c);
installKeyboardActions((JLabel)c);
}
< prev index next >