List of usage examples for javax.swing JLabel setDisabledIcon
@BeanProperty(visualUpdate = true, description = "The icon to display if the label is disabled.") public void setDisabledIcon(Icon disabledIcon)
From source file:IconInterfaceDemo.java
public static void main(String[] a) { JFrame mainFrame = new JFrame(); JLabel label = new JLabel("label"); label.setIcon(new ColoredSquare(Color.green)); label.setDisabledIcon(new ColoredSquare(Color.red)); mainFrame.getContentPane().add(label); mainFrame.setSize(100, 100);/* w w w . j a v a2s . c om*/ mainFrame.setVisible(true); }