How to open file on my local system using Java program ?
Example
import java.awt.Desktop;
Desktop myNewBrowserDesktop = Desktop.getDesktop();
try {
// Open local file
myNewBrowserDesktop.open(new File("C:\\files\\notice.pdf"));
} catch (URISyntaxException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}
No comments:
Post a Comment
Note: only a member of this blog may post a comment.