http://hg.idempiere.com/idempiere/issue/6 https://sourceforge.net/projects/adempiere/forums/forum/610548/topic/4409004
This commit is contained in:
parent
787f6095a5
commit
fba1c3e5a4
|
@ -17,6 +17,7 @@
|
|||
package org.compiere.apps;
|
||||
|
||||
import java.awt.BorderLayout;
|
||||
import java.awt.Desktop;
|
||||
import java.awt.Dimension;
|
||||
import java.awt.FlowLayout;
|
||||
import java.awt.Frame;
|
||||
|
@ -28,6 +29,7 @@ import java.awt.Toolkit;
|
|||
import java.awt.event.ActionEvent;
|
||||
import java.awt.event.ActionListener;
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.util.logging.Level;
|
||||
|
||||
import javax.swing.JFileChooser;
|
||||
|
@ -554,8 +556,19 @@ public final class Attachment extends CDialog
|
|||
// p.waitFor();
|
||||
return true;
|
||||
}
|
||||
else // other OS
|
||||
else // other OS. originally nothing here. add the following codes
|
||||
{
|
||||
try {
|
||||
Desktop desktop = null;
|
||||
if (Desktop.isDesktopSupported()) {
|
||||
desktop = Desktop.getDesktop();
|
||||
File file = new File(tempFile.getAbsolutePath());
|
||||
desktop.open(file);
|
||||
return true;
|
||||
}
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
|
|
Loading…
Reference in New Issue