• Advertisement

Archived

This topic is now archived and is closed to further replies.

[java] jscrollpane

This topic is 5994 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

How do i not have distortion when i put a grid type class inside a jscrollpane. I also would not want to have to redraw the grid everytime a user would try to scroll. I know that maybe somesort of image buffering system could help...but i am lost thanks to all who respond

Share this post


Link to post
Share on other sites
Advertisement
Swing should have an automatic double buffering system..unless it''s an object whose paint method was programmed by you, but it doesn''t seem so from your question.

Share this post


Link to post
Share on other sites
Not a real answer to your question but you might get an idea on how to adapt it to your case :

I had the same problem when painting (rectangles and stuff) on a JPanel and putting that in a JScrollPane. Everytime you scroll, it all gets garbled. I solved that by painting a solid rectangle with the size of the entire JPanel on the back of it (so the rectangles I want to see get painted over that big rectangle).

From then on I had no more messed up pictures. So I guess it might have something to do with the fact that Java gets confused when it doesn''t have anything to draw on a spot and then just puts something there...

******************************
Stefan Baert

On the day we create intelligence and consciousness, mankind becomes God.
On the day we create intelligence and consciousness, mankind becomes obsolete...
******************************

Share this post


Link to post
Share on other sites
Try changing the viewport''s scroll mode. There''s BLIT, BACKINGSTORE and SIMPLE.

Share this post


Link to post
Share on other sites

  • Advertisement