Results 1 to 2 of 2
Thread: JOptionPane
- 03-17-2010, 01:57 PM #1
Member
- Join Date
- Mar 2010
- Posts
- 5
- Rep Power
- 0
JOptionPane
I have a JOption Pane with customised options, I was just wondering if there's a way to make the options do something else other than just close the window when it pops up?
This is what i have so far:
I already have defined methods in this class to play again and exit, and i want them to be called when the user selects one of these options on this JOptionPane. But at the moment, whatever button you click, it just closes the window.Java Code:Object[] options = {"Play Again", "Exit"}; JOptionPane.showOptionDialog (frame, "Player X wins", "Congratulations", JOptionPane.YES_NO_OPTION, JOptionPane.PLAIN_MESSAGE, null, options, options[0]);
-
Similar Threads
-
Help with JOptionPane
By sanctishit in forum New To JavaReplies: 1Last Post: 03-10-2010, 10:20 AM -
need help for JOptionPane....
By keycoffee in forum New To JavaReplies: 1Last Post: 02-09-2010, 08:59 AM -
Help with JOptionPane
By SwEeTAcTioN in forum New To JavaReplies: 12Last Post: 11-03-2009, 04:12 AM -
JOptionpane
By tommyyyy in forum New To JavaReplies: 2Last Post: 03-20-2009, 08:33 AM -
JOptionPane
By whosadork in forum New To JavaReplies: 2Last Post: 10-23-2008, 02:17 AM


LinkBack URL
About LinkBacks

Bookmarks