I would like to change the contents of the list of a JComboBox
(like adding another list in place of and older one). Is there any way I might be able to do that?
Thanks in advance!
If you want to be able to add and remove items from an existing combo box at runtime, the underlying data model for the combo box needs to be a MutableComboBoxModel
Google for that class for interface information and for examples of how to use it.
Note that if you want the user to type in new values, you also need to make the box editable.
You can find some links to examples here.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With