diff --git a/org.adempiere.ui.swing/src/org/compiere/apps/Attachment.java b/org.adempiere.ui.swing/src/org/compiere/apps/Attachment.java index 0d3522c50b..70ac94da50 100644 --- a/org.adempiere.ui.swing/src/org/compiere/apps/Attachment.java +++ b/org.adempiere.ui.swing/src/org/compiere/apps/Attachment.java @@ -64,6 +64,11 @@ public final class Attachment extends CDialog */ private static final long serialVersionUID = 2497487523050526742L; + /** + * Save the last path selected + */ + private static String lastPath = null; + /** * Constructor. * loads Attachment, if ID <> 0 @@ -424,7 +429,8 @@ public final class Attachment extends CDialog private void loadFile() { log.info(""); - JFileChooser chooser = new JFileChooser(); + JFileChooser chooser = new JFileChooser(lastPath); + chooser.setDialogType(JFileChooser.OPEN_DIALOG); chooser.setDialogTitle(Msg.getMsg(Env.getCtx(), "AttachmentNew")); chooser.setMultiSelectionEnabled(true); @@ -463,6 +469,10 @@ public final class Attachment extends CDialog } } } + // Save path of file + if (files.length>0) { + lastPath = files[0].getParentFile().getAbsolutePath(); + } } // getFileName /**