performing pagination on JTable....

Hello.

How to do pagination on JTable... ie when there are more than 10 rows, how to give page numbers below the JTable so that on click of the page the respective rows of the table is shown....

How can mediator pattern be used here... I am in urgent need of this.....

Thanx......

[306 byte] By [serjitha] at [2007-10-3 8:25:13]
# 1

You will have to keep track of how many rows there are and what page is being displayed.

For example if there are 52 rows. Have a variable like startRow.

When the user clicks to the next page increment startRow by 10 and update the table to display the next 10 rows.And do the same if they click it again, and the reveverse if they click previous.

You might be able to find a third party component that does this? I don't know of one off the top of my head.

zadoka at 2007-7-15 3:31:26 > top of Java-index,Desktop,Core GUI APIs...