title: Why does JOptionPane.getValue() continue to return uninitializedValue
body: <p>Below are my code</p>
  
  <pre><code>public static void main(String args[]){
       JOptionPane pane = new JOptionPane();
       pane.showInputDialog(null, "Question");
       Object value = value.getValue();
       System.out.println(value.toString()); --&gt; this will print out uninitializedValue
  
  }
  </code></pre>
  
  <p>I basically want to detect when the user click the cancel in JOptionPane and when the user close the JOptionPane</p>