Java – JFreeChart in scrollpane

javajfreechartjscrollpane

I'm having a big graph created with jfreechart. This chart is too big for the screen, so I would like to put it in a scrollpane. However, when using the scrollbar, the complete graph is redrawn everytime, which makes it extremely slow. Is there a solution for this?

thanks,

Bart

Best Answer

Buffer it yourself. Render the JFreeChart in a panel that is not on a visible panel and use that as your buffer to the panel that is in the scrollpane. Then you can control the repaint events and how often you sync the two panels.

Related Topic