From 7affbb0ef23cb4eed3109d7f35217def5ae65ace Mon Sep 17 00:00:00 2001 From: jppetrakis <> Date: Fri, 3 Mar 2023 22:43:30 -0500 Subject: [PATCH] better initial file location for csv chooser --- swing/src/net/sf/openrocket/gui/main/SimulationPanel.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/swing/src/net/sf/openrocket/gui/main/SimulationPanel.java b/swing/src/net/sf/openrocket/gui/main/SimulationPanel.java index 00d0d4257..7f2b2bc6f 100644 --- a/swing/src/net/sf/openrocket/gui/main/SimulationPanel.java +++ b/swing/src/net/sf/openrocket/gui/main/SimulationPanel.java @@ -688,12 +688,13 @@ public class SimulationPanel extends JPanel { String documentFileName = document.getRocket().getName(); documentFileName += ".csv"; fch.setSelectedFile(new File(documentFileName)); - String csvFileLocation = System.getProperty("user.home") + "/Documents"; + + File currentDir = null; if (!lastSelectedLocation.equals("")) { - csvFileLocation = lastSelectedLocation; + currentDir = new File(lastSelectedLocation); } - fch.setCurrentDirectory(new File(csvFileLocation)); + fch.setCurrentDirectory(currentDir); return fch; }