Win a copy of Testing JavaScript Applications this week in the HTML Pages with CSS and JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

JDialog Box closes main application

 
Ranch Hand
Posts: 455
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 ]
 
Ranch Hand
Posts: 1492
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
    Bookmark Topic Watch Topic
  • New Topic