Computer Forums

Member Login

Remember Me? Sign Up! | Forgot Password
 
Slogan
 
Closed Thread
Old 04-20-2004, 01:45 PM   #1 (permalink)
 
Newb Techie

Join Date: Apr 2004

Posts: 11

baloon

Default help w/ GUI in Java

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!
baloon is offline  
Old 04-20-2004, 09:50 PM   #2 (permalink)
 
Junior Techie

Join Date: Oct 2003

Posts: 85

zoerb

Default

JOptionPane.showConfirmDialog(null,"are you sure", "title",JOptionPane.OK_CANCEL_OPTION);
__________________
Asus A7n8x-x
athlon 2800
radeon 9600 pro
512 mb 2700 mem
western digital 80gb special edition
zoerb is offline  
Old 04-20-2004, 11:53 PM   #3 (permalink)
 
Newb Techie

Join Date: Apr 2004

Posts: 11

baloon

Default

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!
baloon is offline  
Old 04-25-2004, 03:41 PM   #4 (permalink)
 
Junior Techie

Join Date: Oct 2003

Posts: 85

zoerb

Default

if the user presses cancel, itll return null. so just do an if(answer == null) the user pressed cancel
__________________
Asus A7n8x-x
athlon 2800
radeon 9600 pro
512 mb 2700 mem
western digital 80gb special edition
zoerb is offline  
 
Closed Thread

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On