wood burning stoves 2.0*
The moose likes Swing / AWT / SWT and the fly likes Printing a JTextPane Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "Printing a JTextPane" Watch "Printing a JTextPane" New topic
Author

Printing a JTextPane

Frank Hale
Ranch Hand

Joined: Mar 25, 2000
Posts: 230
Can someone point me to a code snippet which demonstrates how to print a JTextPane? Basically what I want to do is load an HTML page into a JTextPane and then print it off.
Thanks,
Frank
Frank Hale
Ranch Hand

Joined: Mar 25, 2000
Posts: 230
Surely someone has to know how to use the print API. Lots of you guys are certified too.
Frank
Janny Tima
Greenhorn

Joined: May 05, 2004
Posts: 2
Use the Smart JPrint APIs that is available for free. In about a minue you should be able to print, preview, optionally PDF generate your Java programs and Swing component (JTextArea, JTextPane, JEditorPane, any JTextComponent , JTable) content and and J2EE program outout.

Lok at the online demo: http://www.activetree.com

About Smart JPrint?

Smart JPrint is a pure Java class library used for the following:
. Creates PDF documents from your J2EE and Java Swing GUI programs
. Prints the output to a printer </li>
. Allows your users to preview the output pages in a GUI window

Features

. 100% pure Java classes
. Generate PDF automatically (automatically breaks text lines, images, rows, columns into pages).
. Print the output to a printer.
. Preview output pages in a wanderful UI (this feature is normally used for Java Swing GUI applications).
. Only few lines of code to Print or generate PDF.
. Only 2 lines of code to generate PDF and Print swing components.
. Print and generate PDF from Swing components such as JTable, JTextArea, JTextPane, JEditorPane etc.
. Write J2EE program output as text, icons, 2D graphics to generate PDF automatically.
. Print and generate PDF for multiple Swing components next to each other.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Printing a JTextPane
 
Similar Threads
how to print the contents of jtextpane.
How to print the contents of a JTextPane
how to print from a JTextPane (or maybe from a DefaultStyledDocument)
Unicode equivalent for &lt;br&gt;. Any idea?
change the text color momentarily