我在 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/