File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Swing / AWT / SWT and the fly likes Printing from JTextArea Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "Printing from JTextArea" Watch "Printing from JTextArea" New topic

Printing from JTextArea

John A Clark

Joined: Jun 24, 2002
Posts: 4
I want to print the contents of a JTextArea. Can anyone help me.
Dirk Schreckmann

Joined: Dec 10, 2001
Posts: 7023
Are you familiar with printing in Java in general? If not, you may want to take a look at these resources for learning the printing API:
  • The Printing trail of Sun's Java Tutorial
  • Chapter 22 - Printing of the book Swing by Matthew Robinson and Pavel Vorobiev is available for downloading as are two other sample chapters at
  • A Five Part Series of Articles on Printing in Java at JavaWorld
  • Also, right now over at, they are providing a free download of the book JDK 1.4 Tutorial by Greg Travis. Chapter 3 covers the print service API.

    [How To Ask Good Questions] [JavaRanch FAQ Wiki] [JavaRanch Radio]
    I agree. Here's the link:
    subject: Printing from JTextArea
    It's not a secret anymore!