Witam!
public class MyCallable implements Callable
{String toReverse;
JTextArea output = new JTextArea();
ServerSocket server = null;
ClientWorker w;
public String call () throws java.io.IOException, InterruptedException {
w = new ClientWorker(server.accept(), output);
Thread t = new Thread(w);
t.start();
///////Thread t = Thread.currentThread();
if (toReverse == null || toReverse.trim().equals(""))
throw new IllegalArgumentException("Set string to reverse");
if (t.isInterrupted()) return null;
char[] org = toReverse.toCharArray();
StringBuffer out = new StringBuffer();
if (t.isInterrupted()) return null;
for (int i = org.length-1; i>=0; i--) {
Thread.sleep(500);
out.append(org[i]);
if (t.isInterrupted()) return null;
output.setText(out.toString());
if (t.isInterrupted()) return null;
}
return out.toString();
}
MyCallable wywoluje Exception in thread "main" java.lang.OutOfMemoryError: unable to create new native thread prosze o pomoc ...gdzie mam blad ?