import java.awt.Desktop;
import java.net.*;
class DesktopTools{
public static void main(String args[])
{
try{
URI u=URI.create("www.google.com");
Desktop ds=Desktop.getDesktop();
ds.browse(u);
}catch(Exception e)
{
System.out.println(" "+ e);
}
}
}
It Will open your default browser and redirect you to google Page. It is user defined if you want to change the website address it will works fine.
import java.net.*;
class DesktopTools{
public static void main(String args[])
{
try{
URI u=URI.create("www.google.com");
Desktop ds=Desktop.getDesktop();
ds.browse(u);
}catch(Exception e)
{
System.out.println(" "+ e);
}
}
}
It Will open your default browser and redirect you to google Page. It is user defined if you want to change the website address it will works fine.
No comments:
Post a Comment
Please post your comments. Your comments make us to write more programs for you.