Link to home
Start Free TrialLog in
Avatar of cicurel
cicurel

asked on

opening a password verification JFrame while program is running.

Hi.

it is a bit hard to explain what i am trying to do, but i will try.
I have a program i wrote, which is running all the time through a connection and calculate things.
And i want to open a JFrame for verificating a password for making some operations in it.
I have managed to create the JFrame with the user and password fields and the buttons.
but i have trouble making the main program / JFrame to wait for the user.

i am looking to make some sort of:
String inputValue = JOptionPane.showInputDialog("Please input a value");

or:
boolean verified = MyOptionPane.waitForVerification();
which opens a JFrame for the user to enter the user and password.

i hope i made myself clear enough here.

Thank you.
ASKER CERTIFIED SOLUTION
Avatar of TimYates
TimYates
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of cicurel
cicurel

ASKER

Thank you very much, it appears i used the JDialog, what does the setModal means?
it is much easier then i thought :)
A modal dialog will freeze execution till you answer it :-)

Not sure why it's called "modal" the dictionary doesn't really help either...something about:

Modal : Something with logical Modality
Modality : The state of a Modal object

bah...language recursion ;-)

So if you set the dialog modal, the program will wait until that dialog is no longer visible (hide() or user closes it)

Good luck!

Tim.