|
|
|||||||||
|
|||||||||
|
|||||||||
| |
|||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
Problems with JComboBox.setSelectedIndex(an Object)
Hi!
We have an application than run with an applet. In some parts we have JComboBoxes components. We use to update de selected component the method setSelectedIndex thta take an object like in parameter. If we run the applet with the java plug-in 1.3 we have no problem to actualized the selected index in the comboBox components but when we run the applet with the java plug-in 1.4 this doesn't work and the index displayed by the combo box is allways which with index 0. Someone know why this happen and the solution??? Any help will be appreciated. Thank you very much. |
|
#2
|
|||
|
|||
|
calabor,
Are you sure you're using setSelectedIndex correctly? I've taken a look at the Java APIs and confirmed my suspicions: public void setSelectedIndex(int anIndex) The setSelectedIndex method doesn't support passing an Object, but rather an index value of type int. You may want to look at the public void setSelectedItem(Object anObject) method, which will likely fix your problem. Source: http://java.sun.com/j2se/1.4.2/docs.../JComboBox.html HTH... |
![]() |
| Viewing: Dev Articles Community Forums > Programming > Java Development > Problems with JComboBox.setSelectedIndex(an Object) |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|