int (Object forValue, JTree tree) { DefaultMutableTreeNode node = (DefaultMutableTreeNode)forValue; int busyRoom = tree.getInsets().left + tree.getInsets().right + getChildIndent(tree) * node.getLevel(); return tree.getVisibleRect().width - busyRoom - 2; }