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
int i = JOptionPane.showInputDialog("Enter number: ")
how could I have something like char[] c = className.showPasswordDialog("Enter password: ") with a JPasswordField instead of a text field?
How can write a method that can be used to instantiate an object through
Share
1 Answer