ButtonCanvasExample
-- implementing a simple custom button as a subclass of
Canvas
.
Experiment:
Click on both the regular button and on the green oval button.
Click slowly to see how each button shows its pressed state.
The source.