package com.mindprod.example;
import java.awt.Desktop;
import java.io.IOException;
import java.net.URI;
import java.net.URISyntaxException;
import static java.lang.System.*;
/**
* Demonstrate how to launch a browser.
*
* @author Roedy Green, Canadian Mind Products
* @version 1.0 2010-03-27 initial version.
* @since 2010-03-27
*/
public final class TestBrowserLaunch
{
/**
* // Launches the default browser to display a URL.
*
* @param args not used
*/
public static void main( String[] args )
{
if ( Desktop.isDesktopSupported() )
{
final Desktop dt = Desktop.getDesktop();
if ( dt.isSupported( Desktop.Action.BROWSE ) )
{
try
{
dt.browse( new URI( "http://www.mindprod.com/index.html" ) );
}
catch ( URISyntaxException | IOException e )
{
err.println( e.getMessage() );
}
}
}
}
}