Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

keypressed

Status
Not open for further replies.

lanfeust

Programmer
Jun 18, 2001
4
BE
I have some problems with the keypressed event in a JComboBox. When the JCombobox has the the keyboardfocus and I press the enter a procedure should be triggered. Problem is that nothing happens. When I did some tests to retrieve the keycode of the enter button and some other buttons, nothing happend either.
 
Is the event listener added to the JComboBox or to the container/component that contains it?
bruce21.jpg
 
The eventlistener is added to the JComboBox
I've tried to solve it by putting the eventlistener an the panel and check if the focus is put on the JComboBox but even when the cursor is in the JComboBox the result of hasFocus() is False.
 
Status
Not open for further replies.

Similar threads

Part and Inventory Search

Sponsor

Back
Top