Java in a Nutshell

Previous Chapter 18
The java.awt Package
Next
 

18.50 java.awt.PrintGraphics (JDK 1.1)

The Graphics object returned by the getGraphics() method of PrintJob always implements this PrintGraphics interface. You can use this fact to distinguish a Graphics object that draws to the screen from one that generates hardcopy. This is a useful thing to do in a paint() method when you want to generate hardcopy that differs somewhat from what is displayed on-screen.

The getPrintJob() method defined by this interface can also be used, of course, to return the PrintJob with which the PrintGraphics object is associated.

public abstract interface PrintGraphics {
    // Public Instance Methods
            public abstract PrintJob getPrintJob();
}


Previous Home Next
java.awt.PopupMenu (JDK 1.1) Book Index java.awt.PrintJob (JDK 1.1)

Java in a Nutshell Java Language Reference Java AWT Java Fundamental Classes Exploring Java