• Post Reply Bookmark Topic Watch Topic
  • New Topic

JTable - Tab Displacement

 
Bharathi Balasubramanian
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In JTable how to change
the tab displacemant from column to row because by default the when you hit
tab it jumps from one column to another but i want from one row to another.
Thanx in Advance
 
deekasha gunwant
Ranch Hand
Posts: 396
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi bala,
i feel u should add keyListener to ur JTable and in keyReleased event u should check if the code of pressed is VK_TAB
& if it is so u should change the focus to the next row using
int oldrow = table.getSelectedRow();
table.setSelectedRow(oldRow+1);
hope this helps
regards
deekasha
 
G Estes
Ranch Hand
Posts: 62
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I realize this is an old thread, but maybe it will surface again. My question is how do you make JTable tabbing tab only between cells that are editable. The Sitraka LiveTable accomplishes this by providing a traversable property. If JTable can't do this, what about an alternative to Sitraka (their prices are going up and it's becoming cost-prohibitive).
 
Rohit Bhagwat
Ranch Hand
Posts: 205
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by deekasha gunwant:
hi bala,
i feel u should add keyListener to ur JTable and in keyReleased event u should check if the code of pressed is VK_TAB
& if it is so u should change the focus to the next row using
int oldrow = table.getSelectedRow();
table.setSelectedRow(oldRow+1);

hope this helps
regards
deekasha


I am unable to add KeyListener to cell of JTable. Can anyone please show me a sample example of how should I add KeyListener to cell ?
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!