• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

JDialog Box closes main application

 
Ranch Hand
Posts: 455
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
reply
    Bookmark Topic Watch Topic
  • New Topic