JOptionPane can be used to get string inputs from user, but in my case, I want to display a password field in showInputDialog.
The way I need is the input given by the user should be masked and the return value must be in char[]. I need a dialog box with a message, password field, and two buttons. Can that be done? Thanks.
Yes, it is possible using
JOptionPane.showOptionDialog(). Something like this: