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:
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?
JLabel jLabel1 = null;
Then, if I can get that to work, how do I access that same label from my (seperate) Main class?