+ 1
Multithread problem !
try { String sr = textArea1.getText(); Pattern pat = Pattern.compile("(https?|rtmp|http)://[-a-zA-Z0-9+&@#/%?=~_|!:,.;]*[-a-zA-Z0-9+&@#/%=~_|]", Pattern.DOTALL); ` Matcher matcher = pat.matcher(sr); int count = 0; while (matcher.find()) { new Thread(" "){ public void run(){ try { URL url = new URL (matcher.group()); URLConnection yc1 = url.openConnection(); ...........
2 Answers
+ 1
new Thread(new Runnable(){
public void run(){
//code...
}
}).start();
0
thanks bro but the problem that matcher group inside thread won't work it's seems that's must be final!?