Java 如何在BasicTreeUI上关闭密钥处理
BasicTreeUI(在JDK1.5中)通过导航到树上以该字母开头的项目来处理JTree上的关键事件。关闭该行为最直接的方法是什么?我认为最直接的方法是覆盖该方法:Java 如何在BasicTreeUI上关闭密钥处理,java,swing,jtree,Java,Swing,Jtree,BasicTreeUI(在JDK1.5中)通过导航到树上以该字母开头的项目来处理JTree上的关键事件。关闭该行为最直接的方法是什么?我认为最直接的方法是覆盖该方法: 我不太了解JTree,但它提供了一种可以自定义的方法: JTree tree = new JTree(...) { public TreePath getNextMatch(String prefix, int startingRow, Position.Bias bias) { return ge
我不太了解JTree,但它提供了一种可以自定义的方法:
JTree tree = new JTree(...)
{
public TreePath getNextMatch(String prefix, int startingRow, Position.Bias bias)
{
return getLeadSelectionPath();
}
};
JTree tree = new JTree(...)
{
public TreePath getNextMatch(String prefix, int startingRow, Position.Bias bias)
{
return getLeadSelectionPath();
}
};