treepath path = selectionmodel.getselectionpath();
defaultmutabletreenode node = (defaultmutabletreenode)path.getlastpathcomponent();
treepath parentpath = path.getparentpath();
defaultmutabletreenode parentnode = (defaultmutabletreenode)parentpath .getlastpathcomponent();
prentnode.getparent();
獲得DOM節點
核心 瀏覽器網頁就是乙個dom樹形結構!要操作乙個dom節點,就必須要先獲得這個dom節點 獲得dom節點 對應css 選擇器 var h1 document.getelementsbytagname h1 var p1 document.getelementbyid p1 var p2 docum...
JS 獲得節點
var ele ev.parentnode var elem child ele.childnodes for var i 0 in elem child console.log ele.firstchild var b a.childnodes 獲取a的全部子節點 var c a.parentno...
js 子節點與父節點
doctype html en utf 8 viewport content width device width,initial scale 1.0 document title ul style head ul li li li ul children 檢視自己的子節點 var ul docum...