Here you can find the source of getMutableTreeNodes(TreeNode[] path)
private static DefaultMutableTreeNode[] getMutableTreeNodes(TreeNode[] path)
//package com.java2s; //License from project: Apache License import javax.swing.tree.DefaultMutableTreeNode; import javax.swing.tree.TreeNode; public class Main { private static DefaultMutableTreeNode[] getMutableTreeNodes(TreeNode[] path) { if (path == null) return null; DefaultMutableTreeNode[] nodes = new DefaultMutableTreeNode[path.length]; for (int i = 0; path != null && i < path.length; i++) { nodes[i] = (DefaultMutableTreeNode) path[i]; }/*from w ww . j av a2 s.co m*/ return nodes; } }