0

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?

APerson
  • 8,140
  • 8
  • 35
  • 49
Sam
  • 151
  • 8

1 Answers1

0

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().

Community
  • 1
  • 1
APerson
  • 8,140
  • 8
  • 35
  • 49