Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Cancel a call to the repaint() method

 
Amit Agarwal
Ranch Hand
Posts: 92
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi
I am developing a CAD application and am using a JPanel to display some heavy graphics. When the user draws a new object I have to repaint the JPanel to display the underlying drawing. The repaint method is called quite a no. of times, and the response of the software is very slow.
How can I cancel an incomplete call to the repaint() method of the JPanel if I get another request for repaint().
Also, is it possible that the underlying drawing on the JPanel remains undisturbed even if a new object(eg. line/circle etc.) is being drawn and erased repeatedly on it.
Thanks in advance.
---------------
Amit Agarwal
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!