Example usage for javax.swing ButtonModel isEnabled

List of usage examples for javax.swing ButtonModel isEnabled

Introduction

In this page you can find the example usage for javax.swing ButtonModel isEnabled.

Prototype

boolean isEnabled();

Source Link

Document

Indicates if the button can be selected or triggered by an input device, such as a mouse pointer.

Usage

From source file:Main.java

public static void main(String[] args) {
    JButton button = new JButton("Test");
    ButtonModel model = button.getModel();
    model.addChangeListener(new ChangeListener() {
        public void stateChanged(ChangeEvent e) {
            System.out.println("Armed: " + model.isArmed() + " Enabled: " + model.isEnabled() + " Pressed: "
                    + model.isPressed());
        }/*from w w w .  j  av  a 2s .  c  o m*/
    });

    JOptionPane.showMessageDialog(null, button);
}