super("GUI");
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
Container cp = getContentPane();
JButton bx = new JButton("Throw!");
bx.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent evt) {
throw new IllegalArgumentException("foo");
}
});
cp.add(bx, BorderLayout.CENTER);
JButton cl = new JButton("Close");
cl.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent evt) {
System.exit(0);
}
});
cp.add(cl, BorderLayout.SOUTH);
setBounds(200, 200, 200, 100);