Example usage for javax.swing AbstractButton setPressedIcon

List of usage examples for javax.swing AbstractButton setPressedIcon

Introduction

In this page you can find the example usage for javax.swing AbstractButton setPressedIcon.

Prototype

@BeanProperty(visualUpdate = true, description = "The pressed icon for the button.")
public void setPressedIcon(Icon pressedIcon) 

Source Link

Document

Sets the pressed icon for the button.

Usage

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);
}