I created two JComboBox-es populated with state information. One is for
a shipping address and one for a billing address.
The Combo boxes on on two separate panels using a cardlayout. I want to
be able to do the following:
Allow the user to select an item in the first JComboPanel. Then, on the
second panel, a simple jCheckBox allows the user to indicate that the
shipping address is the same as the billing address. Thus, the item in
the first JComboBox should be copied to the second jComboBox.
I can get this to work fine. BUT, when I uncheck the jCheckBox, I want
the second jComboBox reset to blank. I have tried several methods to
achieve this, and they do not work as I want.
jComboBox1.setSelectedIndex(-1) -->throws an out of bounds error,
jComboBox1.setSelectedIndex(0) -->selects the first item in the box
I simply want the box to have no selection when the jcheckBox is
unchecked. Any ideas?
--
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Shannon Brown, President <<< sha...@rubicongulch.com >>>
Rubicon Gulch Software LLC
38 Doe Run Road Suite 260
Manheim PA 17545
http://www.rubicongulch.com
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Try jComboBox1.setSelectedItem(null). This should work.
Bye,
Levent.