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(); content_pane.add(button); 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(); } }