我有一個非常奇怪的問題,JScrollPane
和BorderLayout
。對於簡短的解釋:我有一個JTable,它在JScrollPane內部,這與一個JPanel和一個JTabbedPane上的JTableHeader有關。非常簡單的佈局。如果我只將JTable添加到我的JPanel,按鈕正在工作。如果我添加JScrollPane,按鈕不再工作,所以我不能點擊它們! ActionLister從未到達,我不能看到點擊動畫。BorderLayout中的scrollpane塊按鈕?
一些示例代碼來解釋:
d_pane = new JPanel();
d_button = new JPanel();
d_pane.add(table.getTableHeader(), BorderLayout.PAGE_START);
dl_scroll = new JScrollPane(table);
d_pane.add(dl_scroll, BorderLayout.CENTER);
// d_button is ridLayouted with 3 Buttons in there
d_pane.add(d_button, BorderLayout.PAGE_END);
什麼是組件是'JPane()'你是指Joomla http://api.joomla.org/Joomla-Framework/Table/JTable.html – mKorbel
抱歉意味着JPanel:http://download.oracle。 com/javase/6/docs/api/javax/swing/JPanel.html – reox