• Post Reply Bookmark Topic Watch Topic
  • New Topic

JComboBox in JTable & seletion using keyboard

 
chand desh
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi folks,
I have a JTable with JComboBox as a DefaultCellEditor for one of the columns. Using mouse I can select the value from the combobox. But same thing is not possible using keyboard(?).
1. On pressing F2 the cell goes to editor mode that shows me the JCombobox
2. Then on pressing down arrow key it shows the popup menu of JComboBox.
3. Using arrow keys I can navigate through the values in the JTable.
BUT when pressing enter it does not select the current item.
Any solution to this? Please help.
The same thing works prefectly outside the JTable.

Thanks & Regards,
Chandan D.
 
Chantal Ackermann
Ranch Hand
Posts: 508
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi,
this seems to be a bug:

The situation in which the editable combo box as a table cell editor is mostly
fixed. Pressing F2 will put the focus on the editable portion of the combo box.
However, this exposes another bug in which an enter pressed on the value to
accept the edited contents will move the focus outside the table rather than to
the edited cell. This is because of an incorrect focus cycle when composite
components are used as a table cell editor. This bug existed before this fix
and will be filed under a separate bug.
xxxxx@xxxxx 2002-06-21

http://developer.java.sun.com/developer/bugParade/bugs/4513773.html
Chantal
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!