开发者

Scrollable Pagination Client-servers

开发者 https://www.devze.com 2023-03-19 04:57 出处:网络
I h开发者_如何学编程ave 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 scrollabl

I h开发者_如何学编程ave 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.


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号