I'm trying to build a TreeModel
for a Java application. Since I need to serialize it and send it via an ObjectOutputStream
, I'm trying to use the DefaultTreeModel
because it implements the Serializable
interface.
Ok, I think I'm fine with that.
My question is: Now, how can I build a DefaultTreeModel
containing a directory (passed as argument, a DefaultMutableTreeNode
I guess ?) and all its files and subdirectories ?
I achieved that with a JTree
but it seems not to be Serializable so now I'm stucked because I'm unable to understand the doc examples.