I have a JComboBox
with a custom Editor.
Why I make a selection from the dropdown list, I find that setItem()
method of the Editor is called twice with the same selected item from the drop list.
Why is that?
I have a JComboBox
with a custom Editor.
Why I make a selection from the dropdown list, I find that setItem()
method of the Editor is called twice with the same selected item from the drop list.
Why is that?
As explained here:
It fires twice because one item becomes DESELECTED and another becomes SELECTED. Event fires for both. You can check which one occured by calling
e.getStateChange()
.