好像没有最直接的办法,但可以这样:
先getRowCount()
Returns the number of rows in this table's model.
数出总记录数,然后changeSelection(int rowIndex, int columnIndex, boolean toggle, boolean extend)
Updates the selection models of the table, depending on the state of the two flags: toggle and extend.
改变焦点。
先getRowCount()
Returns the number of rows in this table's model.
数出总记录数,然后changeSelection(int rowIndex, int columnIndex, boolean toggle, boolean extend)
Updates the selection models of the table, depending on the state of the two flags: toggle and extend.
改变焦点。
解决方案 »
- java使用(class类)反射机制实现对类的创建和初始化,比如一个javabean类
- 在netbeans里如何使用表格
- 二分插入算法,请帮我看看我的代码错在那里?我已经走进死胡同了,脑子糊涂了.好几天想不通!
- 问个菜鸟问题
- dom4j中用dtd验证xml时出的错误
- 初学者编写的链表程序编译通过了,运行时老报错误(望达人求助一下,谢了)
- 超级简单的问题,这个问题发了好长时间了,还是没有得到答案
- 如何理解反射(reflection)?
- 又一个Swing的问题!
- 100分求一个正则表达式
- jb6中开发entity bean当structure面板的列类型发生变化时,如何更新已生成的bean
- 还是applet的socket的问题,请多指教。
此方法的确可以将焦点总是指向最后一行,但屏幕总是显示第一页,
有什么方法确保每逢一打开 JTable 屏幕,显示的就是 JTable 的最后一页.
谢谢!!!
此方法的确可以将焦点总是指向最后一行,但屏幕总是显示第一页,
有什么方法确保每逢一打开 JTable 屏幕,显示的就是 JTable 的最后一页.
谢谢!!!
所以问有什么方法确保每逢一打开 JTable ,屏幕显示的就是 JTable 的最后一页的数据。
敬请指教!!!
p.setLocation(0, jTable.getSelectedRow() *jTable.getRowHeight());
jScrollPane.getViewport().setViewPosition(p);
试试,jScrollPane是你jTable所在的滚动窗格