8
我在我的項目中的JScrollPane
中添加了JPanel
。如何提高JScrollPane的慢速滾動速度?
所有工作正常,但有一個關於鼠標滾動的問題,使用JPanel中的鼠標滾輪。滾動速度非常慢。如何讓它更快?
我的代碼是:
JPanel panel = new JPanel();
panel.setLayout(new BorderLayout());
objCheckBoxList = new CheckBoxList();
BaseTreeExplorer node = (BaseTreeExplorer)projectMain.objCommon.tree.getLastSelectedPathComponent();
if (node.getObject() != null) {
cmbList.setSelectedItem(node.getParent().toString());
} else {
if (node.toString().equalsIgnoreCase("List of attributes")) {
cmbList.setSelectedIndex(0);
} else {
cmbList.setSelectedItem(node.toString());
}
}
panel.add(objCheckBoxList);
JScrollPane myScrollPanel = new JScrollPane(panel);
myScrollPanel.setPreferredSize(new Dimension(200, 200));
myScrollPanel.setBorder(BorderFactory.createTitledBorder("Attribute List"));
感謝@mbaydar的回覆。 – Ronak 2012-04-12 08:04:35