File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Swing / AWT / SWT and the fly likes How to use requestFocus() in JTable Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "How to use requestFocus() in JTable" Watch "How to use requestFocus() in JTable" New topic
Author

How to use requestFocus() in JTable

Naapa Sekhar Ramesh
Greenhorn

Joined: Nov 07, 2001
Posts: 12
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.


SCJP
Renee Zhang
Ranch Hand

Joined: Sep 10, 2001
Posts: 72
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

Joined: Nov 07, 2001
Posts: 12
Thank you Mr Renee. It is working fine.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How to use requestFocus() in JTable