Copyright (c) SEMM NL All rights reserved.
Author : Paul Hamaker. Part of JavaLessons.com
Bino is the simplest bean possible : it extends java.awt.Canvas and implements java.io.Serializable, so an instance of it can be saved and restored .
It has a constructor without arguments, a default constructor, as it should.
In a typical builder tool, a bean can be chosen from a palette and dropped on a surface, causing the tool to generate corresponding code.
Some of the bean's properties will already be visible, like
background, foreground, enabled, visible etc,
.... corresponding to Component's set- and get-methods.
Bino is a Canvas is a Component.
A bean can extend any class, it does NOT have to be Canvas. We do it because we want a GUI bean, a visual one. We could instead have used javax.swing.JPanel or some other non-gui class.
Because it's a canvas subclass it returns information about its size by implementing getPreferredSize and getMinimumSize.