BrianMc1958
asked on
NEWBIE: How to end JOptionPane?
Dear Experts,
I just popped a JOptionPane (thanks, CEHJ!) into a class. Works beautifully, but after I click "Yes", and the box goes away, and my class would otherwise end, it does not end. I'm assuming I have to explicitly kill the JOptionPane thread, but I don't know how? (I'm running it inside of Eclipse.)
This is the code snippet:
Object[] options =
{
"Yes", "No"
};
int n = JOptionPane.showOptionDial og(null, "Some Question? "
, "Some Title", JOptionPane.YES_NO_CANCEL_ OPTION,
JOptionPane.QUESTION_MESSA GE, null, options, options[1]);
return n;
Thanks again,
BrianMc1958
I just popped a JOptionPane (thanks, CEHJ!) into a class. Works beautifully, but after I click "Yes", and the box goes away, and my class would otherwise end, it does not end. I'm assuming I have to explicitly kill the JOptionPane thread, but I don't know how? (I'm running it inside of Eclipse.)
This is the code snippet:
Object[] options =
{
"Yes", "No"
};
int n = JOptionPane.showOptionDial
, "Some Title", JOptionPane.YES_NO_CANCEL_
JOptionPane.QUESTION_MESSA
return n;
Thanks again,
BrianMc1958
Do you have a JFrame?
ASKER
No. (AFAIK.) This is just an internal tool, to I'm using NULL for the frame, and it's then popping up inside of Eclipse. If there is no easy solution here, that's fine. I can always kill it manually...
ASKER
"This is just an internal tool, SO... "
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
This is a common thing. JOptionPane does this all the time :)
Try it out *outside* Eclipse first to see if it's really a problem
i have seen this problem before....
and I was on UNIX csh....
It is similar to a JFrame being .hide() instead of System.exit(0).
and I was on UNIX csh....
It is similar to a JFrame being .hide() instead of System.exit(0).
you need to use System.exit(0) as SamsonChung suggested above.
Thank you.
(YES! I know my Cavaj :)
(YES! I know my Cavaj :)