JTree禁止双击Expand和Collapse的正常解决方法

在中文网页查找的结果貌似非常复杂

查找英文网页结果见
http://stackoverflow.com/questions/1223004/overriding-jtree-double-click-to-prevent-node-expansion

只需使用这个方法:
getCtree().setToggleClickCount(0);


此方法说明如下:
void javax.swing.JTree.setToggleClickCount(int clickCount)
Sets the number of mouse clicks before a node will expand or close. The default is two.

Since:
1.3
@beaninfo
bound: true description: Number of clicks before a node will expand/collapse.

你可能感兴趣的:(swing)