Default Close Operation
I have a login Screen that pops up first in my swing application. When the user puts in an incorrect login, they are prompted to try again, and if they do get it right, the login dialog is disposed of and the main application opens.
How do I code for the program to completely exit if they click the "X" on the login dialog? right now if they close it, it closes the login, but opens the main application, defeating the purpose.
You could try using a WindowListener and listen for WindowClosing events on the login screen.
Does the login dialog return a result code? Does that code say the user clicked the "x" button?
Oops yeah didn't think my suggestion all the way through since it would catch all closing events. Probably should go with what Norm is leading to, a return value indicating whether or not the Login Screen was canceled or not.