Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

constructing a "create new user" wizard

Status
Not open for further replies.

carpeliam

Programmer
Mar 17, 2000
990
US
When my application first starts up, it checks to see if a user has already been created. If so, it just starts the application; if not, it shows a "Create New User" dialog, then shows the application. (The main application is in a class called Console which inherits from JFrame.)

My dilemma is that I'm not sure how to properly listen to when the CreateNewUserWizard closes so that I can open the main Console.

CreateNewUserWizard's default close operation is to "do nothing", as I pop up a confirmation box asking if they're sure before closing.

I'm trying to figure out where to place responsibility. Should the Console class be in charge of figuring out if a user exists, and displaying the dialog if not? Should the class with the main() method decide this? And if so, how can it tell when the dialog has finished, and retrieve the results?

Any and all suggestions would be greatly appreciated.

Liam Morley
lmorley@wpi.edu
"light the deep, and bring silence to the world.
light the world, and bring depth to the silence."
 
You could give the dialog a parameter, which is a reference to a variable of the creating class, and the dialog could set it to true or false.

Or your dialog returns a value on closing.

Or ...

seeking a job as java-programmer in Berlin:
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top