1

How could I save the selected and opened nodes in JTree and reopen it after user restart my Application?

Andrew Thompson
  • 168,117
  • 40
  • 217
  • 433
Feras Odeh
  • 9,136
  • 20
  • 77
  • 121
  • check whether this link is useful http://www.javalobby.org/java/forums/t19857.html – Sajith Aug 27 '12 at 11:21
  • [What have you tried?](http://www.whathaveyoutried.com/) Which part are you stuck with? – Andrew Thompson Aug 27 '12 at 11:42
  • 1
    Possible duplicate of [Remember the values entered on standalone app on the client side](http://stackoverflow.com/questions/4661352/remember-the-values-entered-on-standalone-app-on-the-client-side) or [this question](http://stackoverflow.com/q/8282048/418556) or [this question](http://stackoverflow.com/q/7954183/418556).. – Andrew Thompson Aug 27 '12 at 11:52
  • @Sajith can you add it as an answer so I can accept it? – Feras Odeh Sep 02 '12 at 13:06

1 Answers1

1

We can store the expansion state of JTree and retain it later when required. Check this code example. http://www.javalobby.org/java/forums/t19857.html

Sajith
  • 2,038
  • 7
  • 27
  • 42