Я хочу знайти такий метод, як isNodeExpanded (), щоб перевірити, чи розширений даний вузол JTree чи ні, але я не можу його знайти.
Я знаю, що можу це зробити, відстежуючи розширення вузла за допомогою TreeExpansionListener. Чи є кращий спосіб?
Відповіді:
13 за відповідь № 1JTree.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);
Красиво, JavaDoc :-)
Розширений стан Вузла є ні в TreeModel
але в JTree
.