Java JFrame isAv(JFrame frame)

Here you can find the source of isAv(JFrame frame)

Description

is Av

License

Open Source License

Declaration

public static boolean isAv(JFrame frame) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

import java.io.IOException;

import java.net.MalformedURLException;
import java.net.URL;
import java.net.URLConnection;

import javax.swing.*;

public class Main {
    public static final String ROOT = "http://192.168.1.33:8080/";

    public static boolean isAv(JFrame frame) {
        //Try to access the server 
        try {// w  w w  .  jav  a 2s  .  c o m
            final URL url = new URL(ROOT);
            final URLConnection con = url.openConnection();
            con.connect();

        } catch (MalformedURLException e) {
            JOptionPane.showMessageDialog(frame, "Check Internet Connection");
        } catch (IOException ex) {
            JOptionPane.showMessageDialog(frame, "Check Internet Connection");
            return false;
        }
        return true;
    }
}

Related

  1. giveFrameHalfScreen(final JFrame frame)
  2. igualarFormularios(JFrame destino, JFrame origen)
  3. inputFiles(JFrame argParent)
  4. installEscapeCloseOperation(final JFrame dialog)
  5. internalizeFrame(JFrame frame)
  6. isVisibleNotMinimized(JFrame frame)
  7. jointButton(JFrame frame, final JButton button)
  8. loadImageToFrame(JFrame frame, BufferedImage image)
  9. locateForm(JFrame f, int x, int y, int w, int h)