posted 16 years ago
I can think of several ways to do this:
1) show the combobox in a disabled form and then enable it on radiobutton press, or
2) place the combobox in a JPanel that is held as a "card" for a cardlayout-using jpanel. When a radiobutton is pressed, show the card that holds the combobox. This is the best solution if you have to show and hide several components at once
3) set combobox invisible. make visible on radiobutton press.
4) add and remove combobox as needed. Kind of awkward (it seems to me).
Here's a solution that demonstrates 1) 2) and 3):
Hope it helps.
[ April 30, 2008: Message edited by: pete stein ]