こんにちは私はコンソールから行を読み取るこの単純なコードを持っています、今私はコンソールと同じようにテキストエリアからこの行を読みたいです(Enterキーを押すことで行を読む必要があります)どうすればよいですか?
private DataInputStream co = null;
private DataOutputStream streamOut = null;
public void run()
{ while (thread != null)
{ try
{
streamOut.writeUTF(co.readLine());
streamOut.flush();
}
catch(IOException ioe)
{ System.out.println("Sending error: " + ioe.getMessage());
stop();
}
}
}