com.darwinsys.io
Class TextAreaOutputStream

java.lang.Object
  extended by java.io.OutputStream
      extended by com.darwinsys.io.TextAreaOutputStream
All Implemented Interfaces:
java.io.Closeable, java.io.Flushable

public final class TextAreaOutputStream
extends java.io.OutputStream

Simple way to "print" to a JTextArea; just say PrintStream out = new PrintStream(new TextAreaOutputStream(myTextArea)); Then out.println() et all will all appear in the TextArea.


Constructor Summary
TextAreaOutputStream(javax.swing.JTextArea textArea)
           
 
Method Summary
 void close()
           
 void flush()
           
 void write(int b)
           
 
Methods inherited from class java.io.OutputStream
write, write
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TextAreaOutputStream

public TextAreaOutputStream(javax.swing.JTextArea textArea)
Method Detail

flush

public void flush()
Specified by:
flush in interface java.io.Flushable
Overrides:
flush in class java.io.OutputStream

close

public void close()
Specified by:
close in interface java.io.Closeable
Overrides:
close in class java.io.OutputStream

write

public void write(int b)
           throws java.io.IOException
Specified by:
write in class java.io.OutputStream
Throws:
java.io.IOException


Copyright © 1996-2004 Ian F. Darwin. See license.html for usage license.