JCheckBox: setDisabledSelectedIcon(Icon disabledSelectedIcon) : JCheckBox « javax.swing « Java by API






JCheckBox: setDisabledSelectedIcon(Icon disabledSelectedIcon)

  


import javax.swing.Icon;
import javax.swing.ImageIcon;
import javax.swing.JCheckBox;

public class Main {
  public static void main(String[] argv) throws Exception {

    JCheckBox checkbox = new JCheckBox();

    // Set the unselected state icon
    Icon unselDisIcon = new ImageIcon("nosel-dis-icon.gif");
    checkbox.setDisabledIcon(unselDisIcon);

    // Set the selected state icon
    Icon selDisIcon = new ImageIcon("sel-dis-icon.gif");
    checkbox.setDisabledSelectedIcon(selDisIcon);

  }
}

   
    
  








Related examples in the same category

1.new JCheckBox(Action a)
2.new JCheckBox(String text)
3.new JCheckBox(String text, boolean selected)
4.new JCheckBox(String text, Icon normal)
5.JCheckBox: addActionListener(ActionListener lis)
6.JCheckBox: addChangeListener(ChangeListener lis)
7.JCheckBox: addComponentListener(ComponentListener l)
8.JCheckBox: addItemListener(ItemListener lis)
9.JCheckBox: isSelected()
10.JCheckBox: setBorderPaintedFlat(boolean b)
11.JCheckBox: setDisabledIcon(Icon disabledIcon)
12.JCheckBox: setEnabled(boolean b)
13.JCheckBox: setIcon(Icon defaultIcon)
14.JCheckBox: setMnemonic(int mnemonic)
15.JCheckBox: setPressedIcon(Icon pressedIcon)
16.JCheckBox: setRolloverIcon(Icon i)
17.JCheckBox: setRolloverSelectedIcon(Icon rolloverSelectedIcon)
18.JCheckBox: setSelected(boolean b)
19.JCheckBox: setSelectedIcon(Icon i)
20.JCheckBox: setText(String text) (HTML)
21.JCheckBox: setToolTipText(String text)