2014-02-21 27 views
1

好了,所以我有这样的代码:我如何可以调整一个JScrollPane

//adding the panel which will hold the order table 
JPanel orderPanel = new JPanel(); 
right.add(orderPanel); 
JTable order = new JTable(orderData, orderColumnNames); 
JScrollPane orderPane = new JScrollPane(order); 
orderPanel.add(orderPane); 

而且我希望能够消除这种空间:

The description of what I want to remove

我猜的空间被制成JScrollPane,但我找不到任何方法来调整JScrollPane到JTable的大小

+0

你有没有试过这个http://stackoverflow.com/questions/13213645/set-size-of-jtable-in-jscrollpane-and-in-jpanel-with-the-size-of-the-jframe和this http://stackoverflow.com/questions/6234530/problems-with-jtable-and-jscrollpane-size? – nikis

+0

ty尼基斯我想做没有setprefferedsize但显然我需要使用它 –

回答

相关问题