List of usage examples for javax.swing AbstractButton setSelectedIcon
@BeanProperty(visualUpdate = true, description = "The selected icon for the button.") public void setSelectedIcon(Icon selectedIcon)
From source file:Main.java
public static void main(String[] args) { AbstractButton jb = new JToggleButton("Press Me"); jb.setSelectedIcon(new MyIcon()); JFrame f = new JFrame(); f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); f.getContentPane().add(jb);/*from ww w . j ava2s . com*/ f.pack(); f.setVisible(true); }