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 editor application and open a file for editing.

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

written by objects \\ tags: , , , ,

Oct 03

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

Following shows how to launch a browser to display a URI.

URI uri = new URI("http://www.objects.com.au");
Desktop desktop = Desktop.getDesktop();
desktop.browse(uri);

written by objects \\ tags: , , , ,