better initial file location for csv chooser

This commit is contained in:
jppetrakis 2023-03-03 22:43:30 -05:00
parent f1400c5c0f
commit 7affbb0ef2

View File

@ -688,12 +688,13 @@ public class SimulationPanel extends JPanel {
String documentFileName = document.getRocket().getName(); String documentFileName = document.getRocket().getName();
documentFileName += ".csv"; documentFileName += ".csv";
fch.setSelectedFile(new File(documentFileName)); fch.setSelectedFile(new File(documentFileName));
String csvFileLocation = System.getProperty("user.home") + "/Documents";
File currentDir = null;
if (!lastSelectedLocation.equals("")) { if (!lastSelectedLocation.equals("")) {
csvFileLocation = lastSelectedLocation; currentDir = new File(lastSelectedLocation);
} }
fch.setCurrentDirectory(new File(csvFileLocation)); fch.setCurrentDirectory(currentDir);
return fch; return fch;
} }