1 7 8 package javax.swing.plaf.metal; 9 10 import com.sun.java.swing.SwingUtilities2; 11 import javax.swing.*; 12 import javax.swing.plaf.*; 13 import javax.swing.plaf.basic.*; 14 15 16 import java.awt.*; 17 18 19 27 28 public class MetalLabelUI extends BasicLabelUI 29 { 30 protected static MetalLabelUI metalLabelUI = new MetalLabelUI (); 31 private final static MetalLabelUI SAFE_METAL_LABEL_UI = new MetalLabelUI (); 32 33 34 public static ComponentUI createUI(JComponent c) { 35 if (System.getSecurityManager() != null) { 36 return SAFE_METAL_LABEL_UI; 37 } else { 38 return metalLabelUI; 39 } 40 } 41 42 49 protected void paintDisabledText(JLabel l, Graphics g, String s, int textX, int textY) 50 { 51 int mnemIndex = l.getDisplayedMnemonicIndex(); 52 g.setColor(UIManager.getColor("Label.disabledForeground")); 53 SwingUtilities2.drawStringUnderlineCharAt(l, g, s, mnemIndex, 54 textX, textY); 55 } 56 } 57 58 | Popular Tags |