JScrollPane makes a double content drawing.. how to avoid it ?

Hi, I'm developping a game tool in which I'm using a JScrollPane containing a JPanel for which I have redefined the paint(Graphics) method.

In order to have the fastest possible rendering, I have disabled the double buffering and defined my panel as opaque.

My panel is drawed twice when the scroll pane updates ( when resizing or repainting overlaped areas ).

How can I avoid my panel's paint method to be called twice ? Is it normal ? Is it a bug ? I'm using the J2SE 1.4.2_01.

Thank you..

Alexis.

[540 byte] By [alexis.pautrota] at [2007-9-30 0:40:42]
# 1
hi.i believe you should be overriding paintComponent(Graphics g) instead of paint(Graphics g).maybe thats where your problem is.
conoratoa at 2007-7-16 5:12:31 > top of Java-index,Archived Forums,Swing...