This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
Gregg Bolinger wrote:If the dialog is as simple as you imply, just dispose of it when you are done and create a new instance when you need it.
I am with Gregg here.
You will find this easier, especially if you are using the JOptionPane.showXXX methods to create the dialog. It can still be done with JOptionPane but that would mean unnecessary complications and more lines of code which in my opinion is not worth the effort. Easiest would be provide a new instance of your input field, which would be 1 line of code.