MyCanvas: Instance Variables
class MyCanvas extends Canvas implements ActionListener {
// constructor ???
public void paint(Graphics g) {
// requires shapeSpec, currentColor
}
public void actionPerformed(ActionEvent e) {
// requires red, green, currentColor
}
// instance variables
Button red, green;
TextField shapeSpec;
Color currentColor;
}
Previous slide
Next slide
Back to first slide
View graphic version