List of usage examples for javax.swing AbstractButton setPressedIcon
@BeanProperty(visualUpdate = true, description = "The pressed icon for the button.") public void setPressedIcon(Icon pressedIcon)
From source file:Main.java
public static void main(String[] args) { AbstractButton jb = new JToggleButton("Press Me"); jb.setPressedIcon(new MyIcon()); System.out.println(jb.getPressedIcon()); JFrame f = new JFrame(); f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); f.getContentPane().add(jb);/*from w ww . j ava 2s . c om*/ f.pack(); f.setVisible(true); }