• Post Reply Bookmark Topic Watch Topic
  • New Topic

Program doesn't close through JDialog Box

 
Ryan Daguman
Ranch Hand
Posts: 33
Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi CodeRanch. Again I am faced with another dilemma in Java programming. I have a practice exercise here wherein I will add a JOptionPane to a program. When the close button is clicked, the JOptionPane will appear asking the user to exit the program. If the user clicks "Yes," it'll, of course, close the entire program and not just the JOptionPane, but if the user clicks "No," it will return to the program. Please refer to my code below:



The exercise said it must be placed before the EXIT_ON_CLOSE portion. Please help me. Thank you so much!
 
Rob Camick
Ranch Hand
Posts: 2699
10
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Closing an Application may help you understand the whole process better. It also shows a simple example along with a more complex solution.
 
Ryan Daguman
Ranch Hand
Posts: 33
Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I really thank you for your help sir Rob Camick. I learned so many about closing a program with that linked that you provided. Maraming salamat po!
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!