• Post Reply Bookmark Topic Watch Topic
  • New Topic

JOptionPane Question!

 
Ben Jass
Ranch Hand
Posts: 98
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How can I add an action to certain events that take place in a JOptionPane? For example:



How could I add an action for if a user clicks the "Play Again" Button? How could I add an action if the user clicks the "Quit" button?
 
Rob Camick
Ranch Hand
Posts: 2699
10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The showOptionDialog(...) method returns an int value that indicates which button was pressed.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!