Swing performance
1 posts in topic
Flat View  Flat View

Posted By:   Lun_Xiao
Posted On:   Friday, October 26, 2001 02:09 PM

I draw 10000 squares using Java2D on a panel and add this panel to a scroll
pane. When the scroll pane is scroll,
it is very slow to react. I think it
is because of the repaint of the
10000 squares. How can I solve this
problem? Thanks.

Re: Swing performance

Posted By:   Christopher_Brind  
Posted On:   Saturday, October 27, 2001 06:01 AM

a couple of options spring to mind:

1. in your panel's constructor draw your squares to an off-screen image then just draw the entire image.

2. work out of from the view which sqaures you actually need to draw and only draw the ones you need to.

About | Sitemap | Contact