Creating login/logout functionality with swing.

indigo0086 <[email protected]> Fri, 6 Jun 2008 07:36:03 -0700 (PDT)
Newsgroups gmane.comp.java.netbeans.user-interface
Message-ID <[email protected]>
Basically have a a class that implements JDialog and shows a login screen, it
has a boolean value which indicates if the result was OK or not (in this
case, the login was valid or the user canceled).  Basically the simple
functionality looks like this

[code]
                Login l = new Login(null, true);
                l.setVisible(true);
                
                if(l.getResult())
                    new MainForm().setVisible(true);
                else
                    System.exit(0);
[/code]

Now this works well, if the user presses ok, the event for the button sets
the result to true and the login data is valid, false if canceled.  The
window is shown if the result is true.  

The only thing is the MainForm class has a File Menu option with logout,
which I intend to have the main form close and the login dialog to show up
again so another use can login.  I trued putting the code above in a loop
with a guard that cna be changed in the main-form via a callback, but since
hte main form is modeless, the login pops up right after it is shown.  Also
system.exit closes the entire application.  Is there a way to do it the way
I want?
-- 
View this message in context: http://www.nabble.com/Creating-login-logout-functionality-with-swing.-tp17693669p17693669.html
Sent from the Netbeans - UI mailing list archive at Nabble.com.