- You've broken the paint chain. Failing to call
super.paint
is preventing the applet from preparing theGraphics
context for painting, by removing anything that might have been painted to it before. There's no need to overrideupdate
, as you're not doing anything with it. - Typically, you should avoid overriding
paint
of top level containers, as they aren't double buffered and will flicker as they are repainted - You should avoid using
Applet
and instead use a combination ofJApplet
a (for example)JPanel
as your drawing surface . In fact, if you're just learning. It would be better to useJFrame
as applets have a lot of additional management - Painting by its very nature is destructive. You need to maintain a list of things that you want to draw. In this, I would recommend a
List
ofPoint
s, which can be used to paint lines, where the last point is the current drag point
Also take a look at Painting in AWT and Swing for details about how painting works