List of usage examples for javax.swing ButtonModel isEnabled
boolean isEnabled();
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); }