Skip to Main Content

Java Programming

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

JLabel not updating text in GUI

807606May 10 2007 — edited May 18 2007
i've spent about an hour trying to get my label to update from another class. i set the label to public and i tried to invoke setText() on it from the other class, but it doesnt change it in the GUI. i printed the getText() method of the label and it's identical to what i tried to set it to be, but it just isnt displaying the correct text.

i know to update in the GUI it needs to repaint itself, but this is automatic for setText() and it is working for the local calls to setText().

i have a method
	public void setStatus(String text)
	{
		status.setText(text);
	}
that should do exactly what i want, but it only works when called from its own class..... HELP
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jun 15 2007
Added on May 10 2007
10 comments
4,947 views