Java application get suck when it execute
I made a application which sends some request packets for web servers and it get stuck when the application is running , until the packets are been sent the programs stays stuck . when the process is done it defreez it self .
any idea why ??
Code:
private void reqBtnActionPerformed(java.awt.event.ActionEvent evt) {
for (i=0; i<10; i++) {
try {
URL url = new URL(urlTxt.getText()+":80/");
BufferedReader in = new BufferedReader
(new InputStreamReader(url.openStream()));
String htmlText;
while ((htmlText = in.readLine()) != null) {
resultTxt.setText(resultTxt.getText()+htmlText+"\n");
}
in.close();
} catch (MalformedURLException e) {
resultTxt.setText(""+e);
} catch (IOException e) {
resultTxt.setText(""+e);
}
}
}