Hallo,
ich weis einfach nicht mehr weiter! Ich seh den Fehler nicht, ich hoffe aber Ihr.
Der Thread liest auch was ein! Aber an der Stelle cc.ausgabe.setText() (Zeile 52) kommt der Error...
ich weis einfach nicht mehr weiter! Ich seh den Fehler nicht, ich hoffe aber Ihr.
Code:
/*
* lesethread.java
*
* Created on 7. April 2006, 18:11
*
* To change this template, choose Tools | Options and locate the template under
* the Source Creation and Management node. Right-click the template and choose
* Open. You can then make changes to the template in the Source Editor.
*/
/**
*
* @author dödelup
*/
package chatclient;
import java.io.*;
import java.net.*;
class lesethread extends Thread
{
protected Socket s;
protected BufferedReader in;
protected chatclient cc;
/** Creates a new instance of lesethread */
public lesethread(Socket s)
{
this.s=s;
this.start();
}
public void run()
{
try
{
in = new BufferedReader(new InputStreamReader(s.getInputStream()));
String zeile="x";
System.out.println("Is Ready? " + in.ready());
while (true)
{
zeile=in.readLine();
System.out.println(zeile);
if (zeile.length() > 0)
{
cc.ausgabe.setText(cc.ausgabe.getText() + "'" + zeile + "'" + "\n");
}
}
}
catch (Exception e)
{
System.out.println("Error 3: " + e.toString());
}
}
}
Der Thread liest auch was ein! Aber an der Stelle cc.ausgabe.setText() (Zeile 52) kommt der Error...