I've used an example by Ian F. Darwin关于如何在JTree上显示文件系统,尽管代码对我来说很清楚,但我无法弄清楚为什么我无法展开valueChanged上的树的TreeSelectionListener。下面的代码: package ericsonwrp.republica.vintage.caixa;
/*
* Copyright (c) Ian F.
以下代码是FileTreeModel的修改版本,仅显示目录。然而。我在尝试访问需要管理员权限的文件夹时收到空指针异常。一个例子可能看起来像 Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException
at DirectoryExplorer$FileTreeModel.listDirectories(Dire