import java.awt.*; import java.io.Serializable; public class SimpleBean2 extends Canvas implements Serializable{ private Color color; private String msg = "Hello, World"; //Constructor sets inherited properties public SimpleBean2(){ 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 paint(Graphics g) { g.setColor(Color.blue); g.drawString(msg, 20, 20); } }