|
|
|||||||||||||
Class WPrintJobpublic class WPrintJob extends PrintJob { // Constructors public WPrintJob(String title) throws IOException; // Methods public void end(); public Graphics getGraphics(); public Dimension getPageDimension(); public int getPageResolution(); public boolean lastPageFirst(); public void setPageDimensions(int width, int height); } This class creates Win32 WPrintJob objects that handle printing. This class is similar to the java.awt.PrintJob class, but includes the setPageDimensions method and other improvements. Printing in Java is performed with this and other printing classes, and with the java.awt.Toolkit class. The following example shows how to use Toolkit to print from an applet. Toolkit tools = getToolkit(); WPrintJob wpj = (WPrintJob)tools.getPrintJob(null, "Print?", null); if(wpj != null) { Graphics g = wpj.getGraphics(); if(g != null) { paint(g); g.dispose(); } wpj.end(); } PrintJob | +--WPrintJob ConstructorsWPrintJobpublic WPrintJob(String title) throws IOException; Methodsendpublic void end(); getGraphicspublic Graphics getGraphics(); getPageDimensionpublic Dimension getPageDimension(); getPageResolutionpublic int getPageResolution(); lastPageFirstpublic boolean lastPageFirst(); setPageDimensionspublic void setPageDimensions(int width, int height);
|
© 1998 Microsoft Corporation. All rights reserved. Terms of use. |