BasicTreeUI(在 JDK 1.5 中)通过导航到树上以该字母开头的项目来处理 JTree 上的关键事件。关闭该行为的最直接方法是什么?
问问题
351 次
2 回答
1
我认为最直接的方法是重写createKeyListener方法:
tree.setUI(
new BasicTreeUI(){
protected KeyListener createKeyListener(){ return null; }
}
);
于 2009-07-27T23:24:31.370 回答
0
不太了解JTree,但是它提供了一个可以自定义的方法:
JTree tree = new JTree(...)
{
public TreePath getNextMatch(String prefix, int startingRow, Position.Bias bias)
{
return getLeadSelectionPath();
}
};
于 2009-07-28T02:21:31.047 回答