Example usage for javax.swing AbstractButton getPressedIcon

List of usage examples for javax.swing AbstractButton getPressedIcon

Introduction

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

Prototype

public Icon getPressedIcon() 

Source Link

Document

Returns 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  w  w.  ja  v  a  2  s  .c o m*/
    f.pack();
    f.setVisible(true);
}