public void printText(final JTextArea textArea) {
Thread t = new Thread(new Runnable() {
public void run() {
PrintText it = new PrintText(textArea,
new PageFormat());
PrintMonitor pm = new PrintMonitor(it);
try {
pm.performPrint(true);
} catch (PrinterException pe) {
JOptionPane.showMessageDialog(
TextAreaDialog.this.getOwner(),
resource.getString("printException") +
pe.getMessage());