I have to handle an event in a combobox when the user click the item (not when the combobox change the state).
I have four combobox: (1Combo: Parent category) (2 Combo: The sons of the category 1) (3 Combo: the sons of the category 2) (4 combo: the sons of the category 3)
Each one calls the list to add the items for the other one (the sons of the category choosed).
But my problem is that I have an itemstatechange event and I want to know if the item has been clicked NOT if the combo changes state.
public void itemStateChanged(ItemEvent e) {
if (e.getSource()==jComboBoxCategorias1) {
handleEventCombo1();
}
if (e.getSource()==jComboBoxCategorias2) {
handleEventCombo2();
}
if (e.getSource()==jComboBoxCategorias3) {
handleEventCombo3();
}
if (e.getSource()==jComboBoxCategorias4) {
handleEventCombo4();
}
}