So I wanted to save files needed for the program, but the user has to decide where to save files... But because I dont want the user to select the path everytime he starts the program, the program should save the path where to go to find the files, how to?
I made the user select the file with a JFileChooser.
JButton jButton = new JButton();
JFileChooser jFileChooser = new JFileChooser();
jFileChooser.setCurrentDirectory(new File(System.getProperty("user.home")));
jFileChooser.setDialogTitle("Choose your Path!");
jFileChooser.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY);
if(jFileChooser.showOpenDialog(jButton) == JFileChooser.APPROVE_OPTION){
}
path = jFileChooser.getSelectedFile().getAbsolutePath();
pathBind = jFileChooser.getSelectedFile().getAbsolutePath() + "/binds.jar";
bindFile = new File(pathBind);
If any further information is needed, I'll give it... Sorry if I forgot something^^.
System.getProperty("user.home")to select the user's home directory.