|
Java™ by example!
|
|
|
How do I select a JList item by double-clicking or pressing Enter?
For detecting double-clicking, add a MouseListener and catch the MouseEvents where clickCount is equal to 2. For detecting the enter key, add a KeyListener and check whether the KeyCode is KeyEvent.VK_ENTER. Here's an example:
Further Information
Author of answer: Joris Van den Bogaert
Comments to this answer are only viewable by members. Login or become a member!
|
|
|
|
|