Article View: borland.public.jbuilder.java.language
Article #15057Re: Java Printing
From: Mooney
Date: Wed, 14 Jul 1999 00:00
Date: Wed, 14 Jul 1999 00:00
56 lines
2053 bytes
2053 bytes
It could be that you are trying to print before the top margin on your
page. If you can't see anything at 20, but can see things at 30.
There is a class with JDK1.2.x that gives you the boundaries on a print
job, it is PageFormat.
Hope that helps,
Jay Mooney
In article <7mahjo$p285@forums.borland.com>,
"KYLui" <kll@hkstar.com> wrote:
> I read from a file using BufferedReader...
> I can read the file but i can't print it out to printer why ??
> i can print the statement why ???
> thanks....
>
> ----------------------coding------------------------------------
> public JavaPrinting ()
> {
> try
> {
> in = new BufferedReader (new FileReader("TestReport.txt"));
> }
> catch (IOException e)
> {}
> }
>
> public void paint(Graphics g)
> {
> Font f = new Font("Monospaced",Font.PLAIN,12);
> g.setFont (f);
> String s = new String();
> int x = 20;
> int y = 20;
> try
> {
> while ((s = in.readLine ()) != Null)
> {
> g.drawString(s, x, y); // can't print
why
> ????
> y = y + 10;
> }
> }
> catch (IOException e)
> {
> System.out.println ("Read Error");
> }
> g.drawString("Hello", 30, 30) // can print Hello
> }
>
>
Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.
Technical Details
Message-ID:
<7mismk$rnk$1@nnrp1.deja.com>Path:
arc1-ca.pugleaf.net!unknown!not-for-mailReferences:
<7mahjo$p285@forums.borland.com>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: f74b3,dba916c4c8f7665e X-Google-Attributes: gidf74b3,public From: Mooney <mooneyj@pwrh.com> Subject: Re: Java Printing Date: 1999/07/14 Message-ID: <7mismk$rnk$1@nnrp1.deja.com> X-Deja-AN: 501039777 References: <7mahjo$p285@forums.borland.com> X-Http-Proxy: 1.1 x28.deja.com:80 (Squid/1.1.22) for client 208.154.140.60 Organization: Deja.com - Share what you know. Learn what you don't. X-Article-Creation-Date: Wed Jul 14 20:41:59 1999 GMT Newsgroups: borland.public.jbuilder.java.language X-Http-User-Agent: Mozilla/4.0 (compatible; MSIE 5.0; Windows NT; DigExt)