It's not a secret anymore!*
The moose likes Swing / AWT / SWT and the fly likes Tabbing from a JComboBox inside JTable Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "Tabbing from a JComboBox inside JTable" Watch "Tabbing from a JComboBox inside JTable" New topic
Author

Tabbing from a JComboBox inside JTable

Joe Vigor
Greenhorn

Joined: Nov 05, 2001
Posts: 7
I have a JComboBox inside a JTable. When it has editing focus, it takes me two tabs to traverse to the next cell.
All my other cell editors based on JTextField are working fine. I did have to extend JTextField and set isManagingFocus on the JTextField to true.
I have tried this with the JComboBox as well as creating my own JComboBox editor using the extended JTextField with no luck.
Can anyone help? Thanks.
eric moon
Ranch Hand

Joined: Nov 26, 2000
Posts: 133
You might try adding a keyListener to the combo box. When it sees a tab it could call stopEditing() on the table, and send the tab onto the table. Don't know if that would work. Or you could kludge it to send out a second tab event....
e


<BLOCKQUOTE><font size="1" face="Verdana, Arial">quote:</font><HR>"Those who cast the votes decide nothing. Those who count the<BR>votes decide<BR>everything." <BR> -Joseph Stalin<HR></BLOCKQUOTE>
Joe Vigor
Greenhorn

Joined: Nov 05, 2001
Posts: 7
I so far have been unable to catch a tab key in a JComboBox. I tried adding listeners to the components, but to no avail for the Tab key.
 
Consider Paul's rocket mass heater.
 
subject: Tabbing from a JComboBox inside JTable
 
Similar Threads
JTable
Combobox in JTable
JTable
JTable
JTable: highlight text of cell