81,110
社区成员
发帖
与我相关
我的任务
分享
public void mouseClicked(java.awt.event.MouseEvent e) {
//System.out.println("mouseClicked()"); // TODO Auto-generated Event stub mouseClicked()
String dbgStr="";
try{
url=new URL(txtInput.getText());
HttpURLConnection urlConn=(HttpURLConnection)url.openConnection();
dbgStr="conn-ed";
urlConn.setRequestProperty("User-Agent", "Mozilla/4.0 (compatible; MSIE 5.5; Windows NT 5.0)");
br=new BufferedReader(new InputStreamReader(urlConn.getInputStream(),"utf-8"));
dbgStr="openStream-ed";
fw=new FileWriter("resource/output.txt");
dbgStr="file-ed";
String str;
while((str = br.readLine()) != null)
strGet=strGet+str;
System.out.println(strGet);
br.close();
...
}