Hi, I'd like to be able to put a JTable inside a ScrollPane, so that when the table is large, the horizontal and/or vertical scrollbars 'kick in', and when the JTable is small, I just get a small JTable.
Also I want to limit the size of the scrollpane to say 500 by 500.
I can sort of do it by using the number of rows and columns and cell sizes to work out the full table size, then if this is bigger than 500 by 500, I place it in a scrollpane of that size.
But it gets messy with say just 1 horizontal scrollbar, I cannot see all the rows as the scrollbar takes up space.
Is there a simple way to do this. Thanks for any help