Click to See Complete Forum and Search --> : JTable JScrollPane rows visible : please help


helenerom
January 2nd, 2003, 05:59 AM
Hi,
I need to put a JTable in a JscrollPane, so that there is only 10 rows of the JTable visible in the scrollpane...
if the JTable is put in a JFrame I can't managed to set the size of the JscrollPane to do that..
Does anybody know a way to do that ?

thanks a lot by advance,

Hélène.

Timo Hahn
January 3rd, 2003, 12:43 AM
the size of the JScrollPane and therefor the sizr of the JTable depends on the used layoutmanager. So if you don't use some absolute layoutmanager (like nulllayout or xylayout which is borland specific) it's difficult to archive this.
You can play around with the table model so that it only returns 10 rows at a time, but then you have to implement the paging logic yourself.

Timo