PaintExample -- defining/overriding paint
in Component subclasses.
Experiment to see when button gets painted by your code versus
by the button's native peer component.
- Click on the button.
- Cover (or partially cover) the button with another
window and then re-expose the button.
The source.