开发者

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

开发者 https://www.devze.com 2023-03-15 07:06 出处:网络
Can\'t use an ItemListener because my JComboBox items are generated dinamica开发者_开发知识库lly so that would generate exceptions when the list is empty.

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

精彩评论

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