How can I detect the scrollbar is dragged/clicked in a Jscrollpane?

221 views Asked by At

I have a Jscrollpane with a Jpanel inside. In this Jpanel I draw some shapes. The problem I have is when I scroll up and down. The drawing on the Jpanel appears cut. So I want to redraw the Jpanel every time I drag the scrollbar or click the direction arrows. How can I do it? (Excuse me for not posting a SCCE, I've generated the interface with netbeans and it's quite complicated)

1

There are 1 answers

0
mKorbel On BEST ANSWER

In this Jpanel I draw some shapes. The problem I have is when I scroll up and down. The drawing on the Jpanel appears cut. So I want to redraw the Jpanel every time I drag the scrollbar or click the direction arrows.

I have a Jscrollpane with a Jpanel inside. In this Jpanel I draw some shapes. The problem I have is when I scroll up and down.