Layout manager in a scrollpane.
Hi,
I have a JTable, which is sitting in a scrollpane in a JInternalFrame. The scroller works fine, in that scrollbars appear when the frame is made smaller than the table. So its a bit like this...
paramsTable = JTable(etc)...
iframeParams = JInternalFrame();
scroller = JScrollPane();
scroller.add(paramsTable);
scroller.setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED);
scroller.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_AS_NEEDED);
iframeParams.add(scroller);
However, if the frame is made larger than the table, then the table just sits in the extreme top left corner of the frame. What I would like is for it allways to be centred, so presumably I need to have some sort of layout manager in there? If I try to use 'setLayout' on the scrollpane I get an exception. What should I do? Should I somehow be putting the table into JPanel with the right layout manager and then putting that into the scrollpane (but just trying that means the table is invisible..). I need to sort this out as I'm going to be putting other components there eventually so I need to work out how to manage the layout.
Cheers,
Arwel

