Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

How to focus a particular cell in JTable  RSS feed

 
Naapa Sekhar Ramesh
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
For the input data entered on first column of the JTable,I am fetching required data from database and setting the values on other columns of the table. then i am adding a new row to the table for getting next input data.
My problem is I am not able to focus my cursor by default on the newly added row's firstcolumn so that I can enter the next input data.please suggest me. Thanks in advance.
 
Rajkumar Rangan
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Naapa Ramesh:
Hi,
For the input data entered on first column of the JTable,I am fetching required data from database and setting the values on other columns of the table. then i am adding a new row to the table for getting next input data.
My problem is I am not able to focus my cursor by default on the newly added row's firstcolumn so that I can enter the next input data.please suggest me. Thanks in advance.

try
table.changeSelection(rowIndex,colIndex,true,false);
 
Naapa Sekhar Ramesh
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It is working, Thank you Mr Rajkumar
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!