0

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

mKorbel
  • 109,525
  • 20
  • 134
  • 319
Keith Spriggs
  • 235
  • 1
  • 4
  • 10

1 Answers1

2

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

Cratylus
  • 52,998
  • 69
  • 209
  • 339