Keith Spriggs
Keith Spriggs

Reputation: 235

invoke and wait which interacts with a sub class

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

Upvotes: 0

Views: 48

Answers (1)

Cratylus
Cratylus

Reputation: 54074

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

Upvotes: 2

Related Questions