public class PrintUtilities extends Object implements Printable
If you are going to be printing many times, it is marginally more efficient to first do the following:
PrintUtilities printHelper = new PrintUtilities(theComponent);
then later do printHelper.print(). But this is a very tiny
difference, so in most cases just do the simpler
PrintUtilities.printComponent(componentToBePrinted).
7/99 Marty Hall, http://www.apl.jhu.edu/~hall/java/
May be freely used or adapted.NO_SUCH_PAGE, PAGE_EXISTS| Constructor and Description |
|---|
PrintUtilities(Component componentToBePrinted) |
| Modifier and Type | Method and Description |
|---|---|
static void |
disableDoubleBuffering(Component c)
The speed and quality of printing suffers dramatically if
any of the containers have double buffering turned on.
|
static void |
enableDoubleBuffering(Component c)
Re-enables double buffering globally.
|
void |
print() |
int |
print(Graphics g,
PageFormat pageFormat,
int pageIndex) |
static void |
printComponent(Component c) |
public PrintUtilities(Component componentToBePrinted)
public static void printComponent(Component c)
public void print()
public int print(Graphics g, PageFormat pageFormat, int pageIndex)
public static void disableDoubleBuffering(Component c)
enableDoubleBufferingpublic static void enableDoubleBuffering(Component c)
Copyright © 2019 JULIE Lab, Germany. All rights reserved.