The WPrintJob Class of the com.ms.awt package creates Win32 WPrintJob objects that handle printing.
public 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 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