From owner-freebsd-java@FreeBSD.ORG Mon Jan 26 15:44:50 2004 Return-Path: Delivered-To: freebsd-java@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 18F9716A4CE for ; Mon, 26 Jan 2004 15:44:50 -0800 (PST) Received: from chen.org.nz (chen.org.nz [210.54.19.51]) by mx1.FreeBSD.org (Postfix) with ESMTP id 0C23343D3F for ; Mon, 26 Jan 2004 15:44:48 -0800 (PST) (envelope-from jonc@chen.org.nz) Received: by chen.org.nz (Postfix, from userid 1000) id A49D113620; Tue, 27 Jan 2004 12:44:45 +1300 (NZDT) Date: Tue, 27 Jan 2004 12:44:45 +1300 From: Jonathan Chen To: freebsd-java@freebsd.org Message-ID: <20040126234445.GA28605@grimoire.chen.org.nz> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="EVF5PPMfhYS0aIcm" Content-Disposition: inline User-Agent: Mutt/1.4.1i Subject: JDK1.4.2p6_1 and java.awt.PrintJob X-BeenThere: freebsd-java@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Porting Java to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Jan 2004 23:44:50 -0000 --EVF5PPMfhYS0aIcm Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Hi everyone, I'm having problems with the printing with JDK1.4.2p6_1. The attached code used to work sometime ago (with p4?), and works under Windows as expected, ie Prints 2 pages, with some text. With the latest patchset, I'm missing the second page. Am I missing something here, or did something break? Cheers. -- Jonathan Chen ---------------------------------------------------------------------- Build a man a fire, and he'll be warm for a day. Set a man on fire, and he'll be warm for the rest of his life. --EVF5PPMfhYS0aIcm Content-Type: text/plain; charset=us-ascii Content-Description: PrintTest.java Content-Disposition: attachment; filename="PrintTest.java" import java.awt.*; public class PrintTest { public static void main ( String args []) { JobAttributes job = new JobAttributes (); job.setDialog (JobAttributes.DialogType.COMMON); job.setDefaultSelection (JobAttributes.DefaultSelectionType.ALL); PageAttributes page = new PageAttributes (); page.setOrigin (PageAttributes.OriginType.PRINTABLE); PrintJob pj = Toolkit. getDefaultToolkit (). getPrintJob ( null, "Printer", job, page); if (pj == null) { System.out.println ("Quit"); System.exit (1); } Graphics g = pj.getGraphics (); if (g == null) { System.err.println ("Null on pj.getGraphics()"); System.exit (1); } g.drawString ("This is a test", 0, 20); g.dispose (); pj.end (); System.exit (0); } } --EVF5PPMfhYS0aIcm--