• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Unable to figureout why repaint(); is not doing its job

 
Gajendra Kangokar
Ranch Hand
Posts: 94
1
Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi
i have a code which takes values from xml file and repaint() is called for each new value





but after the control reaches line 1 to call repaint(); ,the control is not entering paint method
same thing is happening in line 2.
but at the end of loop when control reaches repaint(); at line 3 the paint method is called and correct output is got in the applet.
my question is why reapint(); is not working in line 1 and 2.
how to solve this.

Thank you
 
Ulf Dittmer
Rancher
Posts: 42968
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Code running on the event thread (like event handlers) need to return quickly - calling Thread.sleep is a particularly bad idea. You should start a separate thread in which you perform all these actions.
 
Gajendra Kangokar
Ranch Hand
Posts: 94
1
Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
yes, i used threads now and am getting the desired output.
thanks a lot
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic