uk.org.redfelineninja.awt
Class JTextAreaWriter
java.lang.Object
|
+--java.io.Writer
|
+--uk.org.redfelineninja.awt.JTextAreaWriter
- public class JTextAreaWriter
- extends java.io.Writer
This Writer can be connected directly to a JTextArea to provide writer
services directly into a GUI.
- See Also:
JTextArea
Constructor Summary |
JTextAreaWriter(javax.swing.JTextArea ta,
javax.swing.JScrollPane scroll)
Creates a new JTextAreaWriter. |
Method Summary |
void |
close()
|
void |
flush()
|
javax.swing.JTextArea |
getTextArea()
Get the JTextArea that the writer uses. |
void |
setTextArea(javax.swing.JTextArea ta)
Set a new JTextArea to write to. |
void |
write(char[] cbuf,
int off,
int len)
|
Methods inherited from class java.io.Writer |
write, write, write, write |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
JTextAreaWriter
public JTextAreaWriter(javax.swing.JTextArea ta,
javax.swing.JScrollPane scroll)
- Creates a new JTextAreaWriter.
The editable flag of the JTextArea will be set to false as it
should not normally be edited by the user.
setTextArea
public void setTextArea(javax.swing.JTextArea ta)
- Set a new JTextArea to write to.
getTextArea
public javax.swing.JTextArea getTextArea()
- Get the JTextArea that the writer uses.
- Returns:
- the JTextArea used in this Writer
write
public void write(char[] cbuf,
int off,
int len)
throws java.io.IOException
- Specified by:
write
in class java.io.Writer
java.io.IOException
flush
public void flush()
- Specified by:
flush
in class java.io.Writer
close
public void close()
- Specified by:
close
in class java.io.Writer