Example usage for javax.swing AbstractButton setDisabledIcon

List of usage examples for javax.swing AbstractButton setDisabledIcon

Introduction

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

Prototype

@BeanProperty(visualUpdate = true, description = "The disabled icon for the button.")
public void setDisabledIcon(Icon disabledIcon) 

Source Link

Document

Sets the disabled icon for the button.

Usage

From source file:Main.java

public static void main(String[] args) {
    AbstractButton jb = new JToggleButton("Press Me");
    jb.setDisabledIcon(new MyIcon());

    JFrame f = new JFrame();
    f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    f.getContentPane().add(jb);//from w w  w  .j av a  2s. c  om
    f.pack();
    f.setVisible(true);
}