not able to call up function
here is the problem, i not able to call up popup function after catch ( IOException ae) but i work after Try{..
here is the coding
publicvoid actionPerformed(ActionEvent e)
{
if (e.getSource()==ok)
{
try
{
String link = textHttp.getText();
URL url =new URL(link);
URLConnection connection = url.openConnection();
connection.setRequestProperty("User-Agent","Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 1.1.4322; InfoPath.1; .NET CLR 2.0.50727)");// Will set IE user agent (answer from java official forum)
BufferedReader in =new BufferedReader(new InputStreamReader(connection.getInputStream()));
String inputLine;
if ((inputLine = in.readLine()) !=null){
System.out.println("The URL are existed");
if (textHttp !=null){
addItemToList();
addURL b =new addURL("Add URL");
Popup d =new Popup(b,"Item added","The URL is existed and the link is already added\n");
this.dispose();
d.show();
}
}
in.close();
}
catch ( IOException ae)
{
addURL b =new addURL("Add URL");
-> problemPopup d =new Popup(b,"Item added","The URL is no existed and the Invalid link is already added\n");
his.dispose();
d.show();
System.out.println("The URL not existed: " + ae.getMessage());
addinValidItemToList();
textHttp.setText("Http://");
textHttp.requestFocus();
textHttp.selectAll();
}
textHttp.setText("Http://");
textHttp.selectAll();
textHttp.requestFocus();
}
}
thx
null

