Solved

opening a password verification JFrame while program is running.

Posted on 2003-11-05
3
315 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
  • 2
3 Comments
 
LVL 35

Accepted Solution

by:
TimYates earned 250 total points
Comment Utility
Use a JDialog instead of a JFrame, and

setModal( true ) ;
0
 

Author Comment

by:cicurel
Comment Utility
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
Comment Utility
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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
pairstar challenge 2 41
Core Java. What output will be and why ? 6 58
base64 decode encode 12 96
recursion example 16 68
Java had always been an easily readable and understandable language.  Some relatively recent changes in the language seem to be changing this pretty fast, and anyone that had not seen any Java code for the last 5 years will possibly have issues unde…
Introduction This article is the second of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers the basic installation and configuration of the test automation tools used by…
Viewers will learn one way to get user input in Java. Introduce the Scanner object: Declare the variable that stores the user input: An example prompting the user for input: Methods you need to invoke in order to properly get  user input:
This tutorial explains how to use the VisualVM tool for the Java platform application. This video goes into detail on the Threads, Sampler, and Profiler tabs.

743 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

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now