Go Back   CodingForums.com > :: Server side development > Java and JSP

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 09-13-2012, 10:54 AM   PM User | #1
eddy-r3
New to the CF scene

 
Join Date: Sep 2012
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
eddy-r3 is an unknown quantity at this point
2 drop downs based on radio choice

Hi guys, hope you are well.

I am trying to get a menu to alter the drop down values, depending on the radio button choice.

Radio buttons are : Buy or Rent
Drop down Values are :

Buy - 1,2,3,4,5
Rent - 1pw,2pw,3pw,4pw,5pw

Im struggling a little bit, any help would be great!

Many thanks
eddy-r3 is offline   Reply With Quote
Old 09-13-2012, 02:50 PM   PM User | #2
Fou-Lu
God Emperor


 
Fou-Lu's Avatar
 
Join Date: Sep 2002
Location: Saskatoon, Saskatchewan
Posts: 15,741
Thanks: 4
Thanked 2,465 Times in 2,434 Posts
Fou-Lu is a name known to allFou-Lu is a name known to allFou-Lu is a name known to allFou-Lu is a name known to allFou-Lu is a name known to allFou-Lu is a name known to all
http://docs.oracle.com/javase/tutori...ml#radiobutton

In your event listener, you need to swap the model for the JComboBox that you are needing to change the values for. Simply call the .setModel and provide it with a new ComboBoxModel object to display. If you use the DefaultComboBoxModel, you can provide it with an Object[] or a Vector to items.
Fou-Lu is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

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

Forum Jump


All times are GMT +1. The time now is 10:18 PM.


Advertisement
Log in to turn off these ads.