I am developing a small desktop application in JAVA using Netbeans. I place a JTree and dynamically populating it. Every thing went fine now i want to achieve the following two things:
- When the JTree is poupulated it will automatically expanded means
it will start showing all of its nodes till the leaf level - The first leaf node should be
selected by default.
How do i achieve these two behaviors?
Expand all nodes (arbitrary depth):
Select first leaf: