2010-05-19 13 views
7

मैं किसी दिए गए जेटीरी नोड का विस्तार किया गया है या नहीं, यह जांचने के लिए isNodeExpanded() जैसी कोई विधि खोजना चाहता हूं, लेकिन मुझे यह नहीं मिल रहा है।क्या JTree नोड का विस्तार करने के लिए कोई बेहतर तरीका है या नहीं?

मुझे पता है कि मैं TreeExpansionListener के साथ नोड विस्तार को ट्रैक करके ऐसा कर सकता हूं। क्या कोई बेहतर तरीका है?

उत्तर

13

JTree.java:

/** 
* Returns true if the node identified by the path is currently expanded, 
* 
* @param path the <code>TreePath</code> specifying the node to check 
* @return false if any of the nodes in the node's path are collapsed, 
*    true if all nodes in the path are expanded 
*/ 
public boolean isExpanded(TreePath path); 

सुंदर, जावाडोक :-)

एक नोड की विस्तारित स्थिति नहींTreeModel में लेकिन JTree में है।

+0

धन्यवाद, मैं जेटीआर के जावाडोक को देखता हूं :-) – waiting

संबंधित मुद्दे