开发者

JComboBox, what listener when I need to catch a mouse click after a state (has not to be new) is selected?

Can't use an ItemListener because my JComboBox items are generated dinamica开发者_开发知识库lly so that would generate exceptions when the list is empty. I need to catch basically the state after a mouse click event on an item (the problem with MouseListener is that it catches the event even when I open the list of items in the JComboBox).


Try to use ActionListener.

See How to Use Combo Boxes. Especially Handling Events on a Combo Box section.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜