Re: How to print a JTextArea?
- From: "layne79" <layne79@xxxxxxxxx>
- Date: 21 Mar 2007 02:53:54 -0700
Dan Andrews ha scritto:
layne79 wrote:
Hello,
I'm trying to implement a printing mechanism for JTextArea but I have
a problem on extracting lines from it.
I used the xample found at http://java.sun.com/docs/books/tutorial/2d/printing/set.html
(PaginationExample class) but, instead of having available an array of
String (textlines), I have a JTextArea.
I need to replace the instruction
g.drawString(textLines[line], 0, y);
at line 93
with another, taking lines from the textarea.
Dou you know how I can do that?
Layne,
Ever since JDK1.6 the JTextArea has a method called getPrintable that
it gets from JTextComponent. You could start there instead of writing
your own printable.
Sorry but I can't use JDK 1.6
May you suggest an alternative?
Thank you and bye.
.
- Follow-Ups:
- Re: How to print a JTextArea?
- From: Dan Andrews
- Re: How to print a JTextArea?
- References:
- How to print a JTextArea?
- From: layne79
- Re: How to print a JTextArea?
- From: Dan Andrews
- How to print a JTextArea?
- Prev by Date: Re: HTML table used in JTextPane not working with cellspacing="0" attribute
- Next by Date: Re: JTable calls setValueAt with index out of bounds
- Previous by thread: Re: How to print a JTextArea?
- Next by thread: Re: How to print a JTextArea?
- Index(es):
Relevant Pages
|