I am using java swing to display data from my table and using JDBC to retrieve my result. I am trying to implement pagination on my table but i am unable to retrieve data in JTable along with the pagination. Code is as under:
chevalier fo wrote:Seems like you are intrested in code.
Actually, it's exactly the other way around. People here would like to help you, but very few people have the time, patience and willingness to comb through 300+ lines of code with Swing and JDBC intermixed together.
Separate the pagination from the JTable code. Show us how it works separately, and describe in detail how it does not work when put together. Then it's probable someone here will have a look and help you. See SSCCE, ShowSomeEffort and TellTheDetails for more information on this (click the links).
(I, personally, would not use SwingWorker to display records as they are retrieved. Use it to load the whole batch at once in the background (this is good), but not to add records on the fly. Mixing Swing and JDBC code is bad. At the very least, you should have separate methods to read the data from a database, with parameters specifying all that is necessary to read them - such as the first and last record to retrieve.)
subject: Displaying data in JTable which has pagination.