I have a JPanel with several objects embedded in it for which I have overwritten paint(). When I scroll the view port, the portions of the objects that used to be outside the view port are painted in the correct positions in the JPanel, but they also are painted in the header. ??? What have I done wrong? Here is the paint code for the objects in the JPanel. They exist in other JPanels inside the main JPanel mentioned above. Thank you
Try calling invalidate() method.Hope this would solve ur probs good luck
"No one knows what one can do until one tries"<br />-John Kingsley.
Joined: May 07, 2003
I tried calling invalidate on the header with a AdjustmentLister and there was no difference. I call revalidate() and repaint() on the header and after the items being painted in the JPanel flash in the header they disapear. It is also kind of chunky during the scroll. Ideas?
Joined: Oct 10, 2003
k do 1 thing. if u did'nt override the update(Graphics g) method. do it. and call ur paint ur panel only from here. actually i used this approach for removing extra paintings on my applet.Also do try itemChangeListener insted of AdjustmentListener. good luck. Marcus [ October 16, 2003: Message edited by: Marcus Blue ]