hai 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
<BR>
Wilfried LAURENT
Ranch Hand
Joined: Jul 13, 2001
Posts: 269
posted
0
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. W.
kumar mars
Ranch Hand
Joined: Jun 04, 2001
Posts: 34
posted
0
can u please eloberate this
Chantal Ackermann
Ranch Hand
Joined: Sep 28, 2000
Posts: 508
posted
0
hi, 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 (http://java.sun.com/docs/books/tutorial/uiswing/components/). chantal