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 


Edited by mike_2000_17: Fixed formatting

8 Years
Discussion Span
Last Post by abhikr7891

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.

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.