A custom button
Here is an example of a custom component. It is a sub-class of a canvas:
Applet code to test the button
the code for the component itself.