Construct the object including its GUI
super("AliasBeanTest");
Container cp = getContentPane();
AliasBean ab = new AliasBean();
cp.add(BorderLayout.CENTER, ab);
ab.addAlias("ian-cvs", "ian@openbsd.org");
ab.addAlias("ian-dos", "http://www.darwinsys.com/");
cp.add(BorderLayout.SOUTH, quitButton = new JButton("Exit"));
quitButton.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
setVisible(false);
dispose();
System.exit(0);
}
});
addWindowListener(new WindowAdapter() {
public void windowClosing(WindowEvent e) {
setVisible(false);
dispose();
System.exit(0);
}
});
pack();