Skip to Main Content

Java SE (Java Platform, Standard Edition)

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

JScrollPane ViewPort not repainting correctly

843804Jul 25 2002 — edited Jun 13 2005
Hi,

I'm using two JScrollPanes, one above the other that I want to stay in lockstep horizontally by means of the user scrolling only the top pane's horizontal scroll bar, I do this with an event listener attached to the top horizontal scroll bar:

public void adjustmentValueChanged(AdjustmentEvent e) {
JViewport topViewport = this.headerPane.getViewport();
JViewport bottomViewport = this.stripsPane.getViewport();
bottomViewport.setViewPosition( topViewport.getViewPosition() );
}

This works fine... except the components do not repaint correctly in the bottom pane. The clipping region from the initial view seems to remain after a scroll, e.g. if one component is partially obscured before scrolling, the obscured section will still be clipped after the scroll. Fast scrolling causes blurring ghosting edges where components go in and out of view.

Any idea how to prevent this?

TIA Gareth.
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jul 11 2005
Added on Jul 25 2002
6 comments
288 views