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