• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
  • Mikalai Zaikin

JComboBox in JTable & seletion using keyboard

Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
Ranch Hand
Posts: 508
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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

    Bookmark Topic Watch Topic
  • New Topic