java - Refreshing the Jtable is scrolling the table -
when refresh jtable data using custom refresh button, jtable scroll random position. code used is:
jscrollpane jspane = new jscrollpane(); jtable table = new jtable(); jspane.setviewportview(table); getcontentpane().add(jspane, java.awt.borderlayout.center);
i want jtable maintain viewport after refresh. how can achieve this?
as kleopatra said, wierd. still can force:
int scrollposition = scroll.getverticalscrollbar().getvalue(); try { ...do update table... } { scroll.getverticalscrollbar().setvalue(scrollposition); } }
Comments
Post a Comment