aspose file tools
The moose likes Swing / AWT / SWT and the fly likes JComboBox Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Head First Android this week in the Android forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "JComboBox" Watch "JComboBox" New topic


kumar mars
Ranch Hand

Joined: Jun 04, 2001
Posts: 34
is there is any way to change the list displayed in the combobox dynamically
i want to change the whole list
i have a combo box that displays the available fonts this list of fonts have to change as language changes (change of language is done using another combo box)
can i assign a new list to display in the combo box
hoping an immediate help

Wilfried LAURENT
Ranch Hand

Joined: Jul 13, 2001
Posts: 269
You first have to put your encapsulate your list in a objet of a class implementing ComboBoxModel and call the setModel method on the instance of JComboBox.
kumar mars
Ranch Hand

Joined: Jun 04, 2001
Posts: 34
can u please eloberate this
Chantal Ackermann
Ranch Hand

Joined: Sep 28, 2000
Posts: 508
attach an item listener to the first combobox (displaying the languages). when the value gets changed it will call the itemchanged method. within this method you can reset the model of the second combo box. see the tutorial for detailed information (
jQuery in Action, 3rd edition
subject: JComboBox
jQuery in Action, 3rd edition