dcsimg
Selecting items in the JComboBox popup using arrows + enter.
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Anonymous
Posted On:   Tuesday, July 30, 2002 07:00 AM

I'm trying to make a JComboBox perform the following: Show the popup when the user presses [arrow down] Let the user highlight an item using up/down arrow Select the item using the enter key The problem is this: If one uses the mouse the selection is copied from the list to the textfield as expected. However this does not happen when using the arrow keys + enter. The textfield remains empty but an ActionEvent is fired? Am I missing something basic here or..? The JComboBox has the putClientProperty("JComboBox.lightweightKeyboardNavigation", "Lightweight"); workaround set to a   More>>

I'm trying to make a JComboBox perform the following:


  1. Show the popup when the user presses [arrow down]
  2. Let the user highlight an item using up/down arrow
  3. Select the item using the enter key


The problem is this:


If one uses the mouse the selection is copied from the list to the textfield as expected. However this does not happen when using the arrow keys + enter. The textfield remains empty but an ActionEvent is fired?


Am I missing something basic here or..?


The JComboBox has the putClientProperty("JComboBox.lightweightKeyboardNavigation", "Lightweight"); workaround set to avoid all the ActionEvents generated otherwise.

   <<Less

Re: Selecting items in the JComboBox popup using arrows + enter.

Posted By:   bean_java  
Posted On:   Wednesday, July 31, 2002 05:50 AM

I will give you coding about it.
give me your email!


huangbin0791@163.com
About | Sitemap | Contact