java - 如何在 Swing 中为 JTable 提供分页支持?

标签 java swing pagination jtable

我在 Swing Java 中创建了一个 GUI,我在其中使用了 JTable。现在我想通过分页将下一页信息显示到其中。我应该怎么做?

最佳答案

Paging in a Swing JTable看起来是一篇不错的文章。

摘录如下:

As far as I remember the solution for this problem lies in the concept of paging: just retrieve the data that the user wants to see and nothing more. This also means you have to sometimes get extra data from the db server (or appserver) if your user scrolls down the list.

Big was my surprise that there wasn't really an out-of-the-box solution (not even a copy- paste solution) for this problem. Anyone that knows one, please don't hesitate to extend my (rather limited) knowledge of the J2EE platform.

So we dug in, and tried to build a solution ourselves. What we eventually came up with was an adapted TableModel class to takes care of the paging.

关于java - 如何在 Swing 中为 JTable 提供分页支持?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1481138/

相关文章:

excel - 如何使用 "pagination"单击网络中的某个页面?

javascript - 行选择和分页 - Vue

java - 如何在JETTY服务器上部署war文件

java - 如何在JPanel中添加一个可编辑的文本框

java - 无法通过任何对象定位器单击按钮?

java - 使用多个文本字段进行正确的异常处理

java - 无法从命令提示符使用 JAR 连接到 MS SQL Server 2008,但在 Eclipse 中成功运行

java - 使用 Swing 的多线程

java - 我怎样才能像这样组织我的框架?

php-从数组分页数据