help w/ GUI in Java

Status
Not open for further replies.

baloon

Solid State Member
Messages
11
Do you know how to put a JOption pane that is a window to ask if the user "Are you sure you want to cancel the reservation?" w/ the "ok" and "cancel" buttons? If they choose ok, we'll proceed. If they choose "cancel", we'll close the window and do nothing.

Please help if you know!
 
JOptionPane.showConfirmDialog(null,"are you sure", "title",JOptionPane.OK_CANCEL_OPTION);
 
Thanks for the answer! But do you know what I have to do to catch the user's response to see if it is a "Cancel" or a "OK"?

Thx again!
 
if the user presses cancel, itll return null. so just do an if(answer == null) the user pressed cancel
 
Status
Not open for further replies.
Back
Top Bottom