import java.awt.*; import java.io.Serializable; public class SimpleBean3 extends Canvas implements Serializable{ private Color color = Color.black; private String msg = "Hello, World"; //Constructor sets inherited properties public SimpleBean3(){ setSize(100,40); setBackground(Color.red); } public Color getColor() { return color; } public void setColor(Color c) { color = c; repaint(); } // You need both a setter and a getter to have the property // appear in the property sheet in the Beanbox public void setMsg(String msg) { this.msg = msg; } public String getMsg() { return msg; } public void dumb() { setMsg("dumb"); repaint(); } public void paint(Graphics g) { g.setColor(color); g.drawString(msg, 20, 20); } }