How to add two JTree components inside a JScrollPane so that the whole space of the pane is covered by the trees regardless expanded or collapsed?
I am using null layout in my JDialog.
Obviously a single JTree can have only one root. However, that root can be a dummy root which contains just two children - the "actual" roots. Let the JTree hide the root (setRootVisible(false)) and you get the same effect.
I'd probably still use a vertical JSplitPane though, as that way a) you can show that the two trees are actually different, and b) you can have individual scrolling for both trees. If you let the JSplitPane's slider be movable as well you give the user even more control on what he can see at the same time.