| Lecture 13 - slide 24 : 30 Program 2 |
static class WindowCloser extends WindowAdapter{
public void windowClosing(WindowEvent e) {
System.exit(0);
}
} // end WindowCloser
public static void main(String[] args){
Frame f = new Frame("Color adjuster");
f.addWindowListener(new WindowCloser());
ColorPresenter adjuster = new ColorPresenter();
adjuster.init();
f.add("Center", adjuster);
f.pack();
f.setVisible(true);
} // end main |