JTree禁止双击Expand和Collapse的正常解决方法
程序员文章站
2022-07-08 10:46:20
...
在中文网页查找的结果貌似非常复杂
查找英文网页结果见
http://*.com/questions/1223004/overriding-jtree-double-click-to-prevent-node-expansion
只需使用这个方法:
此方法说明如下:
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.
查找英文网页结果见
http://*.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.
上一篇: 正则表达式