I have a progressbar in a.java class(in form).I need to reach it from b.java class .
My progressbar name is jprog.(I put it in form from palet)
How can I set public my progressbar? I cant find it in properties page.
my progressbarr in first class. But I want to change its value in second class.
Thanks.
I have a progressbar in a.java class(in form).I need to reach it from b.java
Share
Consider adding a
PropertyChangeListenerto your first class and using aSwingWorkerin your second class. SwingWorker has a method calledsetProgress()that you can invoke to set the value of your progress bar. You can then override thepropertyChange()method in your first class and do something like this:An example using a couple of classes, ClassA and ClassB can be as follows: