Simply put, a JTree node can be objects any class as long as it implements the TreeNode or MutableTreeNode interface. That's it. You can even use classes that don't implement the interface as long as you provide a wrapper class that does.
Now you ask also:
What can I do to have the ExpressionInputBox show up as the nodes of the tree? Is there a limitation to what kind of objects JTree nodes can be?
This is a two-parter, and in the wrong order.
- Again, for an object to be a viable node, its class must implement TreeNode.
- To display it well (and well is the key), you will likely want to create a TreeCellRenderer that works well with it.