title: How can I add a listener on the ok button of JOptionPane?
body: <p>How can I add a listener on the click of "OK" button of <code>JOptionPane.INFORMATION_MESSAGE</code>.</p>
  
  <p>My JOptionPane is:</p>
  
  <pre><code>JOptionPane.showMessageDialog(null, "Your password is: " + password, "Your Password", JOptionPane.INFORMATION_MESSAGE);
  </code></pre>