Oct 03

The Desktop class was added in Java 6 to handle launching associated applications on the native desktop.

Following shows how to launch the associated application to open a file.

File file = new File("/tmp/file.txt");
Desktop desktop = Desktop.getDesktop();
desktop.open(file);

written by objects \\ tags: , , ,


2 Responses to “How to open file using default application”

  1. Smart Sam Says:

    Great one Thank You…!!!!!

  2. Santhosh T Selvan Says:

    thank you 🙂

Leave a Reply

You must be logged in to post a comment.