Solved

opening a password verification JFrame while program is running.

Posted on 2003-11-05
3
324 Views
Last Modified: 2012-05-04
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.
0
Comment
Question by:cicurel
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 35

Accepted Solution

by:
TimYates earned 250 total points
ID: 9686359
Use a JDialog instead of a JFrame, and

setModal( true ) ;
0
 

Author Comment

by:cicurel
ID: 9686549
Thank you very much, it appears i used the JDialog, what does the setModal means?
it is much easier then i thought :)
0
 
LVL 35

Expert Comment

by:TimYates
ID: 9686564
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.
0

Featured Post

Get 15 Days FREE Full-Featured Trial

Benefit from a mission critical IT monitoring with Monitis Premium or get it FREE for your entry level monitoring needs.
-Over 200,000 users
-More than 300,000 websites monitored
-Used in 197 countries
-Recommended by 98% of users

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Java contains several comparison operators (e.g., <, <=, >, >=, ==, !=) that allow you to compare primitive values. However, these operators cannot be used to compare the contents of objects. Interface Comparable is used to allow objects of a cl…
Java Flight Recorder and Java Mission Control together create a complete tool chain to continuously collect low level and detailed runtime information enabling after-the-fact incident analysis. Java Flight Recorder is a profiling and event collectio…
Viewers learn how to read error messages and identify possible mistakes that could cause hours of frustration. Coding is as much about debugging your code as it is about writing it. Define Error Message: Line Numbers: Type of Error: Break Down…
The viewer will learn how to implement Singleton Design Pattern in Java.

729 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question