title: SwingUtilites: how to return values from another thread in Java?
body: <p>I am trying to make an application in Java. 
  To make Swing work correctly, I did this: </p>
  
  <pre><code>public static void main(String[] array){ 
  
  String outerInput;
  SwingUtilities.invokeLater(new Runnable(){
      @Override
      public void run() {
          // I want this string input.
          String input = JOptionPane.showInputDialog(
              null,"Stop ?", JOptionPane.QUESTION_MESSAGE);  
  });
  // How can I get this input value in String outerInput?
  }
  </code></pre>
  
  <p>How would I get this input string in my main body?</p>