Re: How to print a JTextArea?
- From: "Dan Andrews" <danharrisandrews@xxxxxxxxx>
- Date: 20 Mar 2007 18:07:10 -0700
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.
Cheers,
Dan Andrews
---------------------------
http://www.ansir.ca
.
- Follow-Ups:
- Re: How to print a JTextArea?
- From: Brandon McCombs
- Re: How to print a JTextArea?
- From: layne79
- Re: How to print a JTextArea?
- References:
- How to print a JTextArea?
- From: layne79
- How to print a JTextArea?
- Prev by Date: Re: JFrame from JPanel
- Next by Date: Re: HTML table used in JTextPane not working with cellspacing="0" attribute
- Previous by thread: How to print a JTextArea?
- Next by thread: Re: How to print a JTextArea?
- Index(es):
Relevant Pages
|