Scrollable Pagination Client-servers

℡╲_俬逩灬. 提交于 2019-12-11 00:51:55

问题


I have a client screen display a big list data in a JTable. The client is Swing application. It requests the data from a remote server. The list data need to be displayed in scrollable pagination mode. That means the rows should be requested only when user scroll the table (like the way Oracle Developer displays the queried data). So is the any good practice to follow? My 2 main concerning aspects are data requesting method (e.g. slice query, id caching...) and GUI handling.


回答1:


SwingWorker is ideal for this, as it allows the query to continue in the background while the GUI is continually updated. Because JTable uses the flyweight pattern to render cells, performance—even for thousands of rows—is usually acceptable. Here's an example.

Addendum: If you find that you want to enhance pagination, consider using RowFilter, as suggested here, or simple controls, as shown here.



来源:https://stackoverflow.com/questions/6632829/scrollable-pagination-client-servers

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!