All pastes #580714 Raw Edit

Miscellany

public text v1 · immutable
·published 2007-06-21 06:19 UTC
rendered paste body
package connection;

import javax.swing.*;
import java.io.*;

public class ClientReader implements Runnable {
	private BufferedReader in;
	private Thread t;
	private JTextArea txtChatArea;
	
	ClientReader(BufferedReader bf, JTextArea jta) {
		txtChatArea = jta;
		in = bf;
		t = new Thread(this);
		
		t.start();
	}
	public void run() {
		String str;
		
		try {
			while ((str = in.readLine()) != null) {
				txtChatArea.append("El otro dice: " + str);
			}
		}
		catch(IOException e) { }
		
		
	}
}