V
vikas talwar
Hi Everyone,
below is my code. Please find my question between '?'ed lines.
//------------------------------------------------------------
// CREATE COMBO BOX
//------------------------------------------------------------
if(obj.equals(CSV_COMBO_BOX))
{
_combobox[_combobox_count] = new JComboBox();
//get possible value for combo box
String [] possible_values = get_possible_values(val);
for(int i=0; i < possible_values.length; ++i)
_combobox[_combobox_count].addItem(possible_values);
//set the default value to usr_val
_combobox[_combobox_count].setSelectedItem(usr_val);
// add to panel
panel.add("tab",_combobox[_combobox_count]);
// listner
_combobox[_combobox_count].addItemListener(new ItemListener(){
public void itemStateChanged(ItemEvent e)
{
// ?????????????????????????????????????
// ? I WANT TO UPDATE usr_val here ?
// ? how could i get the value of "i" or
// _combo_box_counter in this block?????????
// ???????????????????????????????<?????
}
});
_combobox_count++;
}
below is my code. Please find my question between '?'ed lines.
//------------------------------------------------------------
// CREATE COMBO BOX
//------------------------------------------------------------
if(obj.equals(CSV_COMBO_BOX))
{
_combobox[_combobox_count] = new JComboBox();
//get possible value for combo box
String [] possible_values = get_possible_values(val);
for(int i=0; i < possible_values.length; ++i)
_combobox[_combobox_count].addItem(possible_values);
//set the default value to usr_val
_combobox[_combobox_count].setSelectedItem(usr_val);
// add to panel
panel.add("tab",_combobox[_combobox_count]);
// listner
_combobox[_combobox_count].addItemListener(new ItemListener(){
public void itemStateChanged(ItemEvent e)
{
// ?????????????????????????????????????
// ? I WANT TO UPDATE usr_val here ?
// ? how could i get the value of "i" or
// _combo_box_counter in this block?????????
// ???????????????????????????????<?????
}
});
_combobox_count++;
}