I'm trying to get an event to fire whenever a choice is made from a JComboBox
.
The problem I'm having is that there is no obvious addSelectionListener()
method.
I've tried to use actionPerformed()
, but it never fires.
Short of overriding the model for the JComboBox
, I'm out of ideas.
How do I get notified of a selection change on a JComboBox
?**
Edit: I have to apologize. It turns out I was using a misbehaving subclass of JComboBox
, but I'll leave the question up since your answer is good.
Question&Answers:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…