package Schmortopf.OutputManager;
/**
* A Writer which is connected to a visible JTextArea.
*/
import java.io.*;
import javax.swing.*;
public class JTextAreaOutputStream extends OutputStream
{
private final JTextArea textArea;
public JTextAreaOutputStream( final JTextArea textArea)
{
this.textArea = textArea;
} // Constructor
/**
* The only method to overwrite :
*/
public void write(int b) throws IOException
{
// Just pass it to the textArea :
final char c = (char)b;
this.textArea.append( "" + c );
}
} // JTextAreaPrintStream
|