I have a JFrame with some a JTextField and a JButton. I want it to behave like JOptionPane.showInputDialog(). Basically, I want to construct it, then call .start() or something which will make it visible and then wait for a button press and then return the contents of the JTextField. I have heard that wait()/notify() might do this, but I don’t know if that’s right for this and if it is, could I see a short example of how to use it?
Share
Here try this code example using
JDialog: