diff --git a/MooBreeder.java b/MooBreeder.java index 5032c81..a5407f0 100755 --- a/MooBreeder.java +++ b/MooBreeder.java @@ -92,10 +92,12 @@ int loadConfirm = fileChooser.showOpenDialog(null); if (loadConfirm == JFileChooser.APPROVE_OPTION) { File loadFile = fileChooser.getSelectedFile(); + if (!loadFile.exists() && !loadFile.getName().endsWith(".dat")) + loadFile = new File(loadFile.getAbsolutePath()+".dat"); int userConfirm = JOptionPane.showConfirmDialog(null, "Load herd from "+loadFile.getName()+"?", "Confirm", JOptionPane.OK_CANCEL_OPTION, JOptionPane.QUESTION_MESSAGE); - if (userConfirm == JOptionPane.OK_OPTION) { + if (userConfirm == JOptionPane.OK_OPTION && loadFile.exists()) { Herd.loadHerd(loadFile.getAbsolutePath()); updateGUI(); }