diff options
Diffstat (limited to 'javax')
-rw-r--r-- | javax/swing/plaf/basic/BasicTreeUI.java | 22 |
1 files changed, 14 insertions, 8 deletions
diff --git a/javax/swing/plaf/basic/BasicTreeUI.java b/javax/swing/plaf/basic/BasicTreeUI.java index db54a1e66..2c8c1e0b7 100644 --- a/javax/swing/plaf/basic/BasicTreeUI.java +++ b/javax/swing/plaf/basic/BasicTreeUI.java @@ -1587,12 +1587,15 @@ public class BasicTreeUI for (int i = startIndex; i <= endIndex; i++, k++) { path[k] = treeState.getPathForRow(i); - isLeaf[k] = treeModel.isLeaf(path[k].getLastPathComponent()); - isExpanded[k] = tree.isExpanded(path[k]); - bounds[k] = getPathBounds(tree, path[k]); + if (path[k] != null) + { + isLeaf[k] = treeModel.isLeaf(path[k].getLastPathComponent()); + isExpanded[k] = tree.isExpanded(path[k]); + bounds[k] = getPathBounds(tree, path[k]); - paintHorizontalPartOfLeg(g, clip, insets, bounds[k], path[k], i, - isExpanded[k], false, isLeaf[k]); + paintHorizontalPartOfLeg(g, clip, insets, bounds[k], path[k], + i, isExpanded[k], false, isLeaf[k]); + } if (isLastChild(path[k])) paintVerticalPartOfLeg(g, clip, insets, path[k]); } @@ -1600,8 +1603,9 @@ public class BasicTreeUI k = 0; for (int i = startIndex; i <= endIndex; i++, k++) { - paintRow(g, clip, insets, bounds[k], path[k], i, isExpanded[k], - false, isLeaf[k]); + if (path[k] != null) + paintRow(g, clip, insets, bounds[k], path[k], i, isExpanded[k], + false, isLeaf[k]); } } } @@ -1611,7 +1615,9 @@ public class BasicTreeUI */ private boolean isLastChild(TreePath path) { - if (path instanceof GnuPath) + if (path == null) + return false; + else if (path instanceof GnuPath) { // Except the seldom case when the layout cache is changed, this // optimized code will be executed. |