All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.openforis.utils.Browser Maven / Gradle / Ivy

package org.openforis.utils;

import java.awt.Desktop;
import java.io.IOException;
import java.net.URI;

import javax.swing.JOptionPane;

public abstract class Browser {

	public static void openPage(URI uri) {
		try {
			Desktop.getDesktop().browse(uri);
		} catch (IOException e) {
			JOptionPane.showMessageDialog(null, "Error opening browser: " + e.getMessage());
		}
	}

	public static void openPage(String url) {
		try {
			openPage(new URI(url));
		} catch (Exception e) {
			// ignore it
		}
	}

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy