File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Applets and the fly likes Unable to figureout why repaint(); is not doing its job Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Applets
Bookmark "Unable to figureout why repaint(); is not doing its job" Watch "Unable to figureout why repaint(); is not doing its job" New topic
Author

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

Gajendra Kangokar
Ranch Hand

Joined: Dec 25, 2012
Posts: 72

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
Marshal

Joined: Mar 22, 2005
Posts: 41104
    
  45
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.


Ping & DNS - my free Android networking tools app
Gajendra Kangokar
Ranch Hand

Joined: Dec 25, 2012
Posts: 72

yes, i used threads now and am getting the desired output.
thanks a lot
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Unable to figureout why repaint(); is not doing its job
 
Similar Threads
Dom to JAXB
Balls are not moving
Connection refused: connect in faces-config.xml
Read xml file placed on localhost
How to get a xml id value in java