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

JTable | Cursor go to Last Record..  RSS feed

 
Leonardo Carreira
Ranch Hand
Posts: 494
Eclipse IDE Java Postgres Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello friends..

How to move record/Cursor to the Last Record in JTable?..
and how to set Focus it?
and the Horizontal Scroll automatically go down to last record..

Thanks in advance..
 
Michael Dunn
Ranch Hand
Posts: 4632
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
to scroll
table.scrollRectToVisible(table.getCellRect(...));

to move the selected cell
table.changeSelection(...);

to blink the cursor in the newly selected cell
table.editCellAt(..);
then get the table's editor component
finally editorComponent.requestFocusInWindow();
 
Leonardo Carreira
Ranch Hand
Posts: 494
Eclipse IDE Java Postgres Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
@Michael Dunn

Thanks sir.. it run well now..
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!