> I'm using a TreeModel to represent a filesystem directory tree for
> presentation by a JTree. The first level of the directory appears fine,
[quoted text clipped - 4 lines]
> java.lang.NullPointerException
> at FileSystemTreeModel.getChild(Unknown Source)
Your model has a problem.
> This is on Mac OS X 10.3, JDK 1.4.2.
>
[quoted text clipped - 15 lines]
> return new File(dir);
> }
Every call to getRoot() will create a new (unnecessary) File object.
> public Object getChild(Object parent, int index) {
> File f = (File)parent;
> if (! f.isDirectory()) {
> return null;
> }
This code can throw a NullPointerException if 'parent' is null. The
call to isDirectory() will fail with the NPE.
<lots of other code with bad stuff snipped>
Have a look at the FileSystemView class. You are trying to reinvent the
wheel.
Jim S.

Signature
Remove my extraneous mandibular appendages to reply via email.