將 JTree 中的 TreeNode 和 TreePath 關連起來

<p> <div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:9D7513F9-C04C-4721-824A-2B34F0212519:03e3fd24-3ec4-4b9e-a8a2-4c92e4f020bd" class="wlWriterEditableSmartContent"><pre class="brush: java; gutter: true; first-line: 1; tab-size: 4; toolbar: true; width: 407px; height: 141px;" style=" width: 407px; height: 141px;overflow: auto;">DefaultMutableTreeNode node; //.... 將node加入到JTree以及其餘操做java

//根據 node 獲取 TreePath TreePath treePath = new TreePath(node.getPath()); // 可進行 isCollapsed collapsePath 等操做了</pre><!-- Code inserted with Steve Dunn's Windows Live Writer Code Formatter Plugin. http://dunnhq.com --></div></p>node

相關文章
相關標籤/搜索