Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to use requestFocus() in JTable

 
Naapa Sekhar Ramesh
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
dear friends
I am adding rows to JTable on run time,I want my focus on a particular cell after adding the new row,i found one method requestFocus()in class JTable.AccessibleJTable.AccessibleJTableCell, How to use it,or any other suggessions, please help me
thanks in advance.
 
Renee Zhang
Ranch Hand
Posts: 72
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am not sure if this is that you want. Please try,
1. clean your table's selection( yourTable.clearSelection()
2. request focus on a cell (yourTable.changeSelection(rowIndex, columnIndex, false, false) . Now the cell is in the input mode and the border is highlight.
I am sorry if it doesn't help.
 
Naapa Sekhar Ramesh
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you Mr Renee. It is working fine.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic