title: Creating a static method like JOptionPane.showInputDialog() but with my own components in the dialog box
body: <p>How can write a method that can be used to instantiate an object through a dialog, and will not instantiate that object until input has been received?  For example, instead of<br>
  <code>int i = JOptionPane.showInputDialog("Enter number: ")</code>
  how could I have something like  <code>char[] c = className.showPasswordDialog("Enter password: ")</code>             with a JPasswordField instead of a text field?</p>