I have this question.
I have the following method:
public static Object[] czyDziala(String[] lista) throws IOException {
for(int i=0 ; i<=lista.length-1;i++){
URL url = new URL(lista[i]);
HttpURLConnection httpCon = (HttpURLConnection) url.openConnection();
int len = httpCon.getContentLength();
if (len>0){
System.out.println(url +new String(" Site Work"));
}else{
System.out.println(url +"Site Don't Work");
}
}
return null;
}
The argument in the method is a list of strings.
JFrame okno = new JFrame();
okno.setSize(1200, 500);
okno.setVisible(true);
okno.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
String [] col = {"Nazwa Witryny"};
String [] listaWitryn = {"http://www.wp.pl",
"http://www.onet.pl","http://mobidev.pl"};
try {
Work.czyDziala(listaWitryn);
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
How can I add a table that is
| Sites Name | Status |
I think that it is wrong method created? But I could be wrong.