Package net.azib.ipscan.gui.actions

Source Code of net.azib.ipscan.gui.actions.BrowserLauncher

/**
* This file is a part of Angry IP Scanner source code,
* see http://www.angryip.org/ for more information.
* Licensed under GPLv2.
*/
package net.azib.ipscan.gui.actions;

import net.azib.ipscan.core.UserErrorException;

import java.awt.*;
import java.net.URI;

/**
* The cross-platform browser launcher
*
* @author Anton Keks
*/
public class BrowserLauncher {
  /**
   * Opens an URL in the default browser.
   * Supports Linux/Unix, MacOS, and Windows
   * @param url
   */
  public static void openURL(String url) {
    try {
      Desktop.getDesktop().browse(new URI(url));
    }
    catch (Exception e) {
      throw new UserErrorException("openURL.failed", url);
    }
  }
}
TOP

Related Classes of net.azib.ipscan.gui.actions.BrowserLauncher

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.