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
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