Hi. I am trying to create a JDialog box that prompts users to log on to a database before they can do anything else with the main application. For some reason, whenever I click on the "X" on the JDialog box I created, it closes the main application also. Could someone take a look at my code and see what I'm doing wrong? Maybe I don't fully understand JDialog?? Thanks for any help in advance!! Here is my main class:
Here is my JDialog class:
[ March 01, 2002: Message edited by: Jennifer Sohl ]
Hi Jennifer, The code that you have shown us won't really help us any at helping you out. In your case, the JDialog needs to provide two different ways out: Let user in, or quit app. The code you have shown us doesn't support any listeners on either the OK or Cancel buttons on the dialog. The X button on the dialog is usually wired to perform the same function as the Cancel button. From your description I would say the X button does exactly as it should: the app quits! Your problem probably lies in the fact that you don't wire either button to any functionality and the function WindowKill might be your problem also. Regards, Manfred.