invoke and wait which interacts with a sub class

55 Views Asked by At

I have found many fine examples of invoke later and invoke and wait across the site. However the issue that I have is that the I would like to get a response from a class which is called by the main method

Could any one provide some code that a main method calls a sub method to see how this is constructed with an invoe and wait method? Thanks in advance

1

There are 1 best solutions below

0
On

SwingUtilities#invokeAndWait or invokeLater take a Runnable as an argument so you can not get a result back.
Look into SwingWorkers where you can do an action in a background thread and get back the result to update the UI inside the EDT