Article View: borland.public.jbuilder.java.language
Article #17912Re: PrintJob.Graphics.drawString() won't accept or recognize form feed (?)
From: John P. McGrath
Date: Sun, 20 Sep 1998 00:00
Date: Sun, 20 Sep 1998 00:00
27 lines
1410 bytes
1410 bytes
David Jensen <jensend@txen.com> wrote:
> I'm doing some crude but effective printing of the contents of a jTable
> using the code snippet below.
>
> public PrintJob pj;
> public Graphics aGraphicsObj = pj.getGraphics();
> aGraphicsObj.drawString(vsHeaderString, XPrintPosition,
> HeaderPrintPosition);
>
> My problem is that I can't print on subsequent pages because the
> drawString() method won't accept or recognize the form feed character ("\f")
> as part of the first (String) parameter to this method.
>
> Is there a better way to do this, or am I overlooking something here? Any
> comments, suggestions, or ideas on this matter would be greatly appreciated.
To end one page and start a new one, dispose the Graphics
using aGraphicsObj.dispose(), and get a new one, using the
PrintJob getGraphics() method.
--
Regards,
John P. McGrath
<mcgrath@enter.net>
<jpm@nscs.fast.net>
Technical Details
Message-ID:
<MPG.106eaa584ccf98779896b4@forums.inprise.com>Path:
arc1-ca.pugleaf.net!unknown!not-for-mailReferences:
<6tufu2$bqo3@forums.borland.com>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: f74b3,4a8341e19e2ed337 X-Google-Attributes: gidf74b3,public From: mcgrath@enter.net (John P. McGrath) Subject: Re: PrintJob.Graphics.drawString() won't accept or recognize form feed (?) Date: 1998/09/20 Message-ID: <MPG.106eaa584ccf98779896b4@forums.inprise.com> X-Deja-AN: 392956918 References: <6tufu2$bqo3@forums.borland.com> Organization: Software Consulting Services Newsgroups: borland.public.jbuilder.java.language