Re: How to print a JTextArea?
- From: Brandon McCombs <none@xxxxxxxx>
- Date: Wed, 21 Mar 2007 22:54:28 -0400
Dan Andrews wrote:
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
Ever since? You say that like 1.6 has been out for ages when in fact it's the latest version available and only came out within the last few months.
it gets from JTextComponent. You could start there instead of writing.
your own printable.
Cheers,
Dan Andrews
---------------------------
http://www.ansir.ca
- 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: Requesting tips, comments for an EDT thread-safe game architecture
- Next by Date: Re: JFrame from JPanel
- Previous by thread: Re: How to print a JTextArea?
- Next by thread: HTML table used in JTextPane not working with cellspacing="0" attribute
- Index(es):
Relevant Pages
|