• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Displaying data in JTable which has pagination.

 
chevalier fo
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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:

 
Wendy Gibbons
Bartender
Posts: 1110
Eclipse IDE Oracle VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What exactly isn't working?
 
chevalier fo
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Wendy Gibbons wrote:What exactly isn't working?

I am trying to retrieve the data from database in JTable which has pagination in it. Pagination works perfectly and so as data retrieval but when i combine them ...things go wrong..
 
Wendy Gibbons
Bartender
Posts: 1110
Eclipse IDE Oracle VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
how does it gor wrong, what sympton are you getting?
 
chevalier fo
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Seems like you are intrested in code.
 
Martin Vajsar
Sheriff
Posts: 3752
62
Chrome Netbeans IDE Oracle
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.)
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic