TAB and JTable

I have a JTable whit some cells editable and some cells not editable, I want to use the TAB button to move from one editable cell to anhoter (editable cell)...Thank you
[182 byte] By [drumskra] at [2007-11-26 21:34:06]
# 1
Try that: http://forum.java.sun.com/thread.jspa?forumID=57&threadID=657819
hellbindera at 2007-7-10 3:15:25 > top of Java-index,Desktop,Core GUI APIs...
# 2
Thank you...but I have other promblem,,,
drumskra at 2007-7-10 3:15:25 > top of Java-index,Desktop,Core GUI APIs...
# 3

this is my code:

tableModel = new DefaultTableModel( new Object[][] {}, columnNames);

table = new JTable(tableModel){

public Class getColumnClass(int column)

{

return getValueAt(0, column).getClass();

}

};

table.setPreferredScrollableViewportSize(new Dimension(500, 70));

table.setRowHeight(25);

table.setFocusable(false);

int vColIndex = 1;

TableColumn col = table.getColumnModel().getColumn(vColIndex);

col.setCellEditor(new MyComboBoxEditor(values));

col.setCellRenderer(new MyComboBoxRenderer(values));

now I add to my code:

table.addKeyListener(new KeyAdapter()

{

public void keyReleased(KeyEvent e)

{

if(e.getKeyCode() == KeyEvent.VK_TAB)

{

System.out.println("work");

}

}

});

but when I push TAB don't obtain any result....I do not why...

drumskra at 2007-7-10 3:15:25 > top of Java-index,Desktop,Core GUI APIs...
# 4

Works fine for me.

If you need further help then you need to create a [url http://homepage1.nifty.com/algafield/sscce.html]Short, Self Contained, Compilable and Executable, Example Program[/url] (SSCCE) that demonstrates the incorrect behaviour, because I can't guess exactly what you are doing based on the information provided.

Don't forget to use the [url http://forum.java.sun.com/help.jspa?sec=formatting]Code Formatting Tags[/url] so the posted code retains its original formatting.

camickra at 2007-7-10 3:15:25 > top of Java-index,Desktop,Core GUI APIs...