First of all, I'm very new to Java and I can just hang up with the stable class non-interfaces I'm stalking for how to get static class and static class to update text class
I am searching for information, but I can not find anything. I need a variable listener here's something I'm trying to do:
public class class 1 {public static int x; Public Stable Zero Process () {To (true) {X = X + 1; }} Then I have another class where I want to pair a variable in the text box
People class Class2 {******} Class 1 .x.changeValue {Form.jLabel1.setText (Class1.X)}} I hope what I am trying to do, it was clear. I am trying to bind a label in a variable.
There is no language specific way in java Audiences on the variable What do you need to do when your code If the variable changes, it can also update JLabel.
You can listen to listeners on buttons and other UI widgets and they can update JLABBL.
In a way you can apply it as follows. Do you know about gates and sets? They are such methods that get the example frequency and settings.
personal int x; Public int getX () {return x; } Public Zero setX (int anX) {x = anX; UpdateLabel ("This is X:" + anX)} Public Zero Process () {While (true) {int anX = getX (); Setx (anx + 1); }}
You should try to reduce the use of the status quo, they encourage "global variable"
Comments
Post a Comment