Simple way to "print" to a JTextArea; just say PrintWriter out = new PrintWriter(new TextAreaWriter(myTextArea)); Then out.println() et all will all appear in the TextArea.
More...
|
static PrintWriter | getTextPrintWriter (TextArea textArea) |
| Factory method for creating a PrintWriter to print to selected TextArea.
|
|
Simple way to "print" to a JTextArea; just say PrintWriter out = new PrintWriter(new TextAreaWriter(myTextArea)); Then out.println() et all will all appear in the TextArea.
Source: http://javacook.darwinsys.com/new_recipes/14.9betterTextToTextArea.jsp
Definition at line 15 of file TextAreaWriter.java.
fi.jyu.mit.fxgui.TextAreaWriter.TextAreaWriter |
( |
final TextArea |
textArea | ) |
|
|
inline |
- Parameters
-
textArea | area where to write |
- Examples:
#import java.io.*;
#import javax.swing.*;
JTextArea text = new JTextArea();
PrintWriter tw = new PrintWriter(new TextAreaWriter(text));
tw.print("Hello");
tw.print(" ");
tw.print("world!");
text.getText() === "Hello world!";
text.setText("");
tw.println("Hello");
tw.println("world!");
text.getText() =R= "Hello\\r?\\nworld!\\r?\\n";
Definition at line 37 of file TextAreaWriter.java.
void fi.jyu.mit.fxgui.TextAreaWriter.close |
( |
| ) |
|
|
inline |
void fi.jyu.mit.fxgui.TextAreaWriter.flush |
( |
| ) |
|
|
inline |
static PrintWriter fi.jyu.mit.fxgui.TextAreaWriter.getTextPrintWriter |
( |
TextArea |
textArea | ) |
|
|
inlinestatic |
Factory method for creating a PrintWriter to print to selected TextArea.
- Parameters
-
textArea | area where to print |
- Returns
- created PrintWriter ready to print to TextArea
- Examples:
#import java.io.*;
#import javax.swing.*;
JTextArea text = new JTextArea();
PrintWriter tw = TextAreaWriter.getTextPrintWriter(text);
tw.print("Hyvää");
tw.print(" ");
tw.print("päivää!");
text.getText() === "Hyvää päivää!";
Definition at line 69 of file TextAreaWriter.java.
void fi.jyu.mit.fxgui.TextAreaWriter.write |
( |
char[] |
cbuf, |
|
|
int |
off, |
|
|
int |
len |
|
) |
| throws IOException |
|
inline |
final TextArea fi.jyu.mit.fxgui.TextAreaWriter.textArea |
|
private |
The documentation for this class was generated from the following file: