I have the following fun
which will be executed by non event dispatching thread. In the middle of thread, I want a
public int fun() throws InterruptedException, InvocationTargetException {
// The following code will be executed by non event dispatching thread.
ChoiceRunnable runabble = new ChoiceRunnable();
SwingUtilities.invokeAndWait(runabble);
return runabble.choice;
}
class ChoiceRunnable implements Runnable {
private int choice;
public void run() {
choice = JOptionPane.showConfirmDialog(SaveToCloudJDialog.this, message, title, JOptionPane.YES_NO_OPTION);
}
}