|
Version 2 of the Clay Shell program is behaviorally like version 1, except that it makes the background of the frame blue. Structurally it is different in that a new class which extends the frame class is defined and used.
|

|
package clay2;
import java.awt.*;
public class Main {
public Main() {
}
public static void main(String[] args) {
ClayFrame frame = new ClayFrame("Clay",Color.BLUE);
}
}
class ClayFrame extends Frame
{
public ClayFrame(String title, Color color) {
super(title);
setSize(400,200);
setBackground(color);
setVisible(true);
}
}
|