用 JList 显示大量数据? [英] Displaying large amount of data with JList?

查看:25
本文介绍了用 JList 显示大量数据?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个 JList,它必须显示 3000 多个项目.我希望列表中有大约 100 个可见"项目,当您滚动并接近可见"项目的结尾(或开头)时,必须在列表中加载下一部分(大约 50 个).有没有什么简单的方法可以做到这一点?

I have a JList, wich must display more than 3000 items. I wish to have "visible" around 100 items in the list, and when you scroll and getting close to the end (or begining) of the "visible" items the next portion (around 50) must be loaded in the list. Is there any simple way of doing this?

推荐答案

没有简单的方法,你必须实现 Pagination(s)

no there are no simple way for that, you have to implements Pagination(s)

  • 最简单的工作是由数据库引擎管理,然后大部分直接支持分页

  • easiest job when is managed by Databases engine, most of then support paginations directly

在模型中,但我从未见过 XxxListModel 的解决方法,而是使用带有一个 Colum 的 JTable,JTable 的分页有一些很好的解决方法

in the Model, but I never seen workaround for XxxListModel, use JTable with one Colum instead, there are some good workaround for Pagination for JTable

这篇关于用 JList 显示大量数据?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆