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);
而且我希望能够消除这种空间:
我猜的空间被制成JScrollPane,但我找不到任何方法来调整JScrollPane到JTable的大小
你有没有试过这个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
ty尼基斯我想做没有setprefferedsize但显然我需要使用它 –