Sunday, 8 November 2015

How to open a website from program in Java

Input

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

public class mydesktop
{
  public static void main(String[] args)
  {
     try{

     Desktop d = Desktop.getDesktop();

     d.browse(new URI("www.google.com"));

      }

     catch(Exception e)
     {}
   }
}

Output


No comments:

Post a Comment