?
Solved

opening a password verification JFrame while program is running.

Posted on 2003-11-05
3
Medium Priority
?
325 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 1000 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

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

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

In this post we will learn how to make Android Gesture Tutorial and give different functionality whenever a user Touch or Scroll android screen.
Basic understanding on "OO- Object Orientation" is needed for designing a logical solution to solve a problem. Basic OOAD is a prerequisite for a coder to ensure that they follow the basic design of OO. This would help developers to understand the b…
Viewers will learn about basic arrays, how to declare them, and how to use them. Introduction and definition: Declare an array and cover the syntax of declaring them: Initialize every index in the created array: Example/Features of a basic arr…
This tutorial will introduce the viewer to VisualVM for the Java platform application. This video explains an example program and covers the Overview, Monitor, and Heap Dump tabs.
Suggested Courses

752 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