1. /*
  2. * @(#)MetalLabelUI.java 1.6 01/11/29
  3. *
  4. * Copyright 2002 Sun Microsystems, Inc. All rights reserved.
  5. * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
  6. */
  7. package javax.swing.plaf.metal;
  8. import javax.swing.*;
  9. import javax.swing.plaf.*;
  10. import javax.swing.plaf.basic.*;
  11. import java.awt.*;
  12. /**
  13. * A Windows L&F implementation of LabelUI. This implementation
  14. * is completely static, i.e. there's only one UIView implementation
  15. * that's shared by all JLabel objects.
  16. *
  17. * @version 1.6 11/29/01
  18. * @author Hans Muller
  19. */
  20. public class MetalLabelUI extends BasicLabelUI
  21. {
  22. protected static MetalLabelUI metalLabelUI = new MetalLabelUI();
  23. public static ComponentUI createUI(JComponent c) {
  24. return metalLabelUI;
  25. }
  26. /**
  27. * Just paint the text gray (Label.disabledForeground) rather than
  28. * in the labels foreground color.
  29. *
  30. * @see #paint
  31. * @see #paintEnabledText
  32. */
  33. protected void paintDisabledText(JLabel l, Graphics g, String s, int textX, int textY)
  34. {
  35. int accChar = l.getDisplayedMnemonic();
  36. g.setColor(UIManager.getColor("Label.disabledForeground"));
  37. BasicGraphicsUtils.drawString(g, s, accChar, textX, textY);
  38. }
  39. }