How can I print a text in two columns using Java Swing?
Posted
by Jonas
on Stack Overflow
See other posts from Stack Overflow
or by Jonas
Published on 2010-05-17T14:52:04Z
Indexed on
2010/05/18
16:51 UTC
Read the original article
Hit count: 171
I have a longer text saved in a String. I would like to print the text in two columns on a single page. How can I do this using Java Swing?
I don't understand how I can wrap the text when it's time to use a new line. I have read Lesson: Printing in the Java tutorial, but I haven't found any useful methods for working with text or Strings except FontMetrics
.
Is there any good methods in the Java API for this or is there any good library I can use for this?
© Stack Overflow or respective owner