🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.jbuilder.java.language
Article #18048

Re: awt.Toolkit

#18048
From: John Niesz
Date: Tue, 25 Aug 1998 00:00
24 lines
1467 bytes
you'll need to get the text from the textarea, get the PrintJob.getGraphics()
graphics instance, and then draw the text to the graphics instance as you
would any other graphics instance (there's a drawText() type member function
of the Graphics class).  when you're done, call dispose() on the graphics
instance, and call end() on the printjob instance, and then it will print.

Isabel Migu�ns wrote:

> hi,
> I've seen that with Toolkit.getPrintJob() you can print an image, with
> getGraphics() and printAll(graphic), i.e. the code should be:
> Toolkit  tol=getToolkit();
> PrintJob jo=tol.getGraphics();
> Graphics gra=jo.getGraphics();
> printAll(gra);
> gra.dispose();
> jo.end();
>
> but I want print a text file or the text area contents on a printer, and I
> don�t find how printing.
> If you know it, please tell me the answer.
>
> Thanks,
> I. Migu�ns.
Technical Details
Message-ID: <35E3794C.D45CCB31@worldnet.att.net>
Path: arc1-ca.pugleaf.net!unknown!not-for-mail
References: <6ru658$gmi11@forums.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII
X-Google-Thread: f74b3,a6cc02d56e2f7bbb
X-Google-Attributes: gidf74b3,public
From: John Niesz <sunrunner15@worldnet.att.net>
Subject: Re: awt.Toolkit
Date: 1998/08/25
Message-ID: <35E3794C.D45CCB31@worldnet.att.net>
X-Deja-AN: 384782612
Content-Transfer-Encoding: 8bit
References: <6ru658$gmi11@forums.borland.com>
To: "Isabel Migu�ns" <sabela-@arrakis.es>
Content-Type: text/plain; charset=iso-8859-1
Organization: Another Netscape Collabra Server User
Mime-Version: 1.0
Newsgroups: borland.public.jbuilder.java.language