Java开发网 Java开发网
注册 | 登录 | 帮助 | 搜索 | 排行榜 | 发帖统计  

您没有登录

» Java开发网 » Java GUI 设计  

按打印兼容模式打印这个话题 打印话题    把这个话题寄给朋友 寄给朋友    该主题的所有更新都将Email到你的邮箱 订阅主题
flat modethreaded modego to previous topicgo to next topicgo to back
话题锁定
该话题已被锁定 - kavinwang , 2004-11-02 08:59
如果您尚不清楚该话题被锁定的原因,请参考论坛规则以及本版公告或者联系本版版主。
作者 Re:JTable排序的问题,请版主看看 [Re:kavinwang]
qineremma





发贴: 34
积分: 0
于 2004-10-29 17:19 user profilesend a private message to usersearch all posts byselect and copy to clipboard. 
ie only, sorry for netscape users:-)add this post to my favorite list
我用了例子里的
SortableTableModel.java
TableSorter.java
SortButtonRenderer.java
BevelArrowIcon.java
BlankIcon.java
用自己的程序代替了SortableTableExample.java

我的主程序是用jtable动态显示数据库里查出来的数据,然后套用上面排序的方法。如果数据列表的条数(RowCount)不变,则不会出错;如果条数变化,就会报错,大概是Vector的大小溢出的错误:
java.lang.ArrayIndexOutOfBoundsException: 2 >= 2

  at java.util.Vector.elementAt(Vector.java:427)

  at javax.swing.table.DefaultTableModel.getValueAt(DefaultTableModel.java:617)

  at com.ctsi.nmp.alarmboard.sort.SortableTableModel.getValueAt(SortableTableModel.java:24)

  at javax.swing.JTable.getValueAt(JTable.java:1760)

  at javax.swing.JTable.prepareRenderer(JTable.java:3686)

  at javax.swing.plaf.basic.BasicTableUI.paintCell(BasicTableUI.java:1149)

  at javax.swing.plaf.basic.BasicTableUI.paintCells(BasicTableUI.java:1051)

  at javax.swing.plaf.basic.BasicTableUI.paint(BasicTableUI.java:974)

  at javax.swing.plaf.ComponentUI.update(ComponentUI.java:142)

  at javax.swing.JComponent.paintComponent(JComponent.java:541)

  at javax.swing.JComponent.paint(JComponent.java:808)

  at javax.swing.JComponent.paintChildren(JComponent.java:647)

  at javax.swing.JComponent.paint(JComponent.java:817)

  at javax.swing.JViewport.paint(JViewport.java:707)

  at javax.swing.JComponent.paintChildren(JComponent.java:647)

  at javax.swing.JComponent.paint(JComponent.java:817)

  at javax.swing.JComponent.paintWithOffscreenBuffer(JComponent.java:4771)

  at javax.swing.JComponent.paintDoubleBuffered(JComponent.java:4724)

  at javax.swing.JComponent._paintImmediately(JComponent.java:4668)

  at javax.swing.JComponent.paintImmediately(JComponent.java:4477)

  at javax.swing.RepaintManager.paintDirtyRegions(RepaintManager.java:410)

  at javax.swing.SystemEventQueueUtilities$ComponentWorkRequest.run(SystemEventQueueUtilities.java:117)

  at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:178)

  at java.awt.EventQueue.dispatchEvent(EventQueue.java:448)

  at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:197)

  at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:150)

  at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:144)

  at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:136)

  at java.awt.EventDispatchThread.run(EventDispatchThread.java:99)




Eclipse使用技巧

话题树型展开
人气 标题 作者 字数 发贴时间
7416 JTable排序的问题,请版主看看 qineremma 206 2004-10-29 16:13
5279 Re:JTable排序的问题,请版主看看 kavinwang 20 2004-10-29 16:47
6576 Re:JTable排序的问题,请版主看看 qineremma 2365 2004-10-29 17:19
5534 Re:JTable排序的问题,请版主看看 qineremma 77 2004-10-29 17:22
5444 Re:JTable排序的问题,请版主看看 floater 15297 2004-10-29 22:56
5843 Re:JTable排序的问题,请版主看看 qineremma 19 2004-11-01 14:32

flat modethreaded modego to previous topicgo to next topicgo to back
  已读帖子
  新的帖子
  被删除的帖子
Jump to the top of page

   Powered by Jute Powerful Forum® Version Jute 1.5.6 Ent
Copyright © 2002-2021 Cjsdn Team. All Righits Reserved. 闽ICP备05005120号-1
客服电话 18559299278    客服信箱 714923@qq.com    客服QQ 714923