The Desktop class was added in Java 6 to handle launching associated applications on the native desktop.
Following shows how to launch the default mail application and open a mail composing window.
Desktop desktop = Desktop.getDesktop();
desktop.mail();
Or you can use a mailto: URI to also fill out the address field.
Desktop desktop = Desktop.getDesktop();
desktop.mail(new URI("mailto:someone@acme.com"));
written by objects
\\ tags: compose, desktop, mail, mailto, native, URI
The Desktop class was added in Java 6 to handle launching associated applications on the native desktop.
Following shows how to print a file with the associated native printing facility.
File file = new File("/tmp/file.txt");
Desktop desktop = Desktop.getDesktop();
desktop.print(file);
written by objects
\\ tags: desktop, file, native, print, printing
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: desktop, file, launch, native