hey , my question is that suppose we have an application runnig . it has a jlabel with some text and now in some function i change the text by using setText()func and continue with some other stuff in the function , now the text that i changed is not getting painted on the label right away . it waits for the function to end before actually changing it.

is there anyway i can change it rightaway before the function is terminated.

public void somefunc(){

                     label.setText(" new text ");
                     // continue with the func 


Perform you function in a Swing Worker Thread, not on the Event Dispatch Thread. I have no time to explain this now, but Google will help.

@jamescherrill - i got it now . thanks for your help :-)