[英]Get index of selected node in a JTree
如何获取其父节点中选定节点的索引。 例如, D
应该是root
索引3。 我尝试使用jTree.getSelectionPath()
,但未显示索引
root
A
B
C
a
D
a
b
c
E
JTree有方法
public int[] getSelectionRows()
public int getMinSelectionRow()
public int getMaxSelectionRow()
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.