I have a desktop application in swing
, and in it, I have a single JFrame
that always stays visible while the application is open. There are also some% modal_dependents dependent on this Frame , which open from certain buttons in JDialogs
.
I'm testing a progress bar using JFrame
(another question asked and answered here ), and I need pass the Frame to this class in order to enable SwingWorker
, however I need to get the Frame instance already open in another class.
In progressBar
, I have a public method called Frame
, which returns the window instance itself, but to use it, I need to already have a Frame object created, but in this case, I can not create another instance , I need to get the one that is already active.
From there, I thought if EDT might somehow allow me to retrieve the current Open Frame, even more so because the classes where I need to make this call, were also started in WBS, but I do not know how to do it .
It is possible, from the event -dispatch-thread (EDT), retrieve this Frame already initialized and visible in the application? If so, how do you do that?