C
cjaouhar
I have a JTable where one of the column could contains differents cell
editor (mainly JTextField and JComboBox). When an editable cell has
focus, and the tab key is pressed, I would like to set focus on the
next editable cell.
All works when tabbing from JTextField. But when a JComboBox is reached
and tab is pressed, I am not able to detect the tab key. Any idea?
My code looks like this...
JComboBox aWidgetCombo = new JComboBox() {
public void processKeyEvent(KeyEvent ke) {
if (ke.getKeyChar() == KeyEvent.VK_TAB) {
if (ke.getID() == KeyEvent.KEY_TYPED) {
setFocusOnNextCell(row,column,ke); //method that find
the next cell to get focus
}
ke.consume();
} else {
super.processKeyEvent(ke);
}
}
};
editor (mainly JTextField and JComboBox). When an editable cell has
focus, and the tab key is pressed, I would like to set focus on the
next editable cell.
All works when tabbing from JTextField. But when a JComboBox is reached
and tab is pressed, I am not able to detect the tab key. Any idea?
My code looks like this...
JComboBox aWidgetCombo = new JComboBox() {
public void processKeyEvent(KeyEvent ke) {
if (ke.getKeyChar() == KeyEvent.VK_TAB) {
if (ke.getID() == KeyEvent.KEY_TYPED) {
setFocusOnNextCell(row,column,ke); //method that find
the next cell to get focus
}
ke.consume();
} else {
super.processKeyEvent(ke);
}
}
};