Based on the description...
Welcome to the wonderful world of reasons why you shouldn't override paint
of top level containers.
Basically, top level containers, like JApplet
are not double buffered, this causes them to flicker when they are updated.
Instead, you should create yourself a custom component, extending from something like JPanel
and override it's paintComponent
method and perform your custom painting there...
Take a look at Performing Custom Painting for more details
All Swing components implement ImageObsever
(from JComponent
), so you should be passing this
as the ImageObserver
parameter to drawImage
, assuming you're calling it from within some JComponent
...