How can I make my Canvas object's background transparent when it is added to applet?

Scott Stanchfield

You can't -- Canvas is a heavyweight component, and obscures anything behind it. Instead of using Canvas as a superclass, use Component. Component allows you to create a lightweight component.

By using Component as the superclass, it will only obscure the things you actually paint over. Any non-painted pixels are "transparent" and you'll see the background.