|
Version 4 of the Clay Shell program is like the third version except that the frame can now be closed in the usual way!
|
package clay4;
import java.awt.*;
import java.awt.event.*;
public class Main {
<<<Just like in the previous version!>>>
}
class ClayFrame extends Frame {
public ClayFrame(String title, Color color, Dimension size) {
super(title);
setBackground(color);
setSize(size.width,size.height);
setVisible(true);
addWindowListener(new CloseWindow());
}
class CloseWindow extends WindowAdapter {
public CloseWindow() {
}
public void windowClosing(WindowEvent event) {
System.exit(0);
}
}
}
|