Click here to Skip to main content
Sign Up to vote bad
good
See more: Java
I have a jtable with many row and is added into jscrollpanel,
 
When i add more a row to table, I want to set selection to new row and scrollbar of table must be scrolled to end row to show end row,
 
I try to use code as below but scrollbar don't scroll to end row.
int curRow = model.getRowCount();
Table.setRowSelectionInterval(curRow -1, curRow -1);
 
please help me!
 
Thank in advance
Posted 25 Feb '13 - 5:52
ngthtra1.3K
Edited 25 Feb '13 - 5:54
richcb12.6K

Comments
TorstenH. - 26 Feb '13 - 1:40
Can't you just set selection and the table moves to the selected position? Should be so imho.
Shubhashish_Mandal - 26 Feb '13 - 4:36
check this http://stackoverflow.com/questions/4890282/howto-to-scroll-to-last-row-on-jtable
april88t - 1 Mar '13 - 23:25
you can also visit this site http://objectmix.com/java/72860-keeping-visible-last-row-jtable.html
DalliaF - 8 Mar '13 - 2:32
try this one also-->http://stackoverflow.com/questions/13446493/display-last-row-in-jtable-java

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Your Filters
Interested
Ignored
     
0 Sergey Alexandrovich Kryukov 259
1 OriginalGriff 220
2 Mahesh Bailwal 159
3 CPallini 143
4 Maciej Los 140
0 Sergey Alexandrovich Kryukov 10,214
1 OriginalGriff 7,819
2 CPallini 4,181
3 Rohan Leuva 3,522
4 Maciej Los 3,089


Advertise | Privacy | Mobile
Web04 | 2.6.130523.1 | Last Updated 25 Feb 2013
Copyright © CodeProject, 1999-2013
All Rights Reserved. Terms of Use
Layout: fixed | fluid