import java.awt.*; import java.awt.event.*; import javax.swing.*; class Example1 extends JFrame { public Example1() { Container content_pane = this.getContentPane(); content_pane.setLayout(new FlowLayout()); JButton button = new JButton("Hello World"); ButtonModel model = button.getModel(); JButton button2 = new JButton("Hello World2"); button2.setModel(model); content_pane.add(button); content_pane.add(button2); setSize(300,300); setVisible(true); //// 1) armed and pressed //// armed = ready to commit //// pressed = button down // model.setArmed(true); // model.setPressed(true); //// 2) active or not // model.setEnabled(false); } public static void main(String argv[]) { new Example1(); } }