View Single Post
  #1 (permalink)  
Old 07-25-2007, 12:27 AM
bdn1404 bdn1404 is offline
Member
 
Join Date: Jul 2007
Posts: 2
bdn1404 is on a distinguished road
Edit JPanel Text During Runtime...from another class
I am very new to Java and am having trouble changing text at runtime in a JLabel. My main class is set up to handle the computation and displays the UI frame when necessary. I am reading in data real-time so i need to be able to constantly change the label in my frame as the data changes.

I have been testing to see if I could make the runtime changes by putting the code directly into the UIFrame's main. I created the label using the Netbeans design editor and then used this code:

Code:
JLabel jLabel1 = null; jLabel1.setText("text");
which gave me no errors, but had no effect on the label. How do I link my code-created instance with the Netbeans-created label?

Then, if I can get that to work, how do I access that same label from my (seperate) Main class?

Thanks

Last edited by bdn1404 : 07-25-2007 at 12:30 AM. Reason: Typo
Reply With Quote
Sponsored Links