JMesa is a dynamic HTML table that allows you to filter, sort, paginate, export and edit your data however you need to. What you will find here is a carefully thought out API that is very easy to use and can be modified for your own needs. Note: JMesa requires JDK1.5 or above.
This article presents with an solution on how to page through large amountsofdata effectively without taking down your database and without keeping it all in memory.