How to check your internet connection using Java Netbeans program with Source Code

 How to check your internet connection using Java Netbeans program with Source Code




*** source code ***

Socket si=new Socket();
InetSocketAddress isa= new InetSocketAddress("www.google.com",80);
try
{
si.connect(isa,0);
JOptionPane.showMessageDialog(null,"successfully connected");
}
catch (Exception e)
{
JOptionPane.showMessageDialog(null,"please connect your internet connection");
}

Comments

Popular posts from this blog

How to make Splash Screen in Java using Netbeans with Source Code

How to set Date & Time in Java Jframe Using Netbeans with Source Code

Validate Mobile Number in Java Using Netbeans with Source Code