1

I got a simple problem, but I do not know how to solve it. I need to save some files in a directory, but I need to save the path to it. Because, when I restart the program, I want that my program looks the folder where I left my files, and build a TreeView in JavaFX. Like eclipse IDE does.

Can someone help me with this?

1 Answers1

-1

You can use OS AppData folders. For example, for Windows it would be /User/AppData/, for Linux you can use /home/{username}/.your_app_name/ Create config file, XML or any format you want.

String configPath = "/home/enchantinggg4/.javaFxApplication/";
File config = new File(configPath + "config.xml");
config.createNewFile();
FileWriter writer = new FileWriter(config);
writer.write(....);
writer.close();

Then you can read it after relaunch or smf.

Yuri Stiopin
  • 105
  • 10