public class ComponentPrinter extends Object implements Printable
ComponentPrinter cp = new ComponentPrinter(someComponent); cp.print();The
print()
method may be invoked multiple times.Modifier and Type | Field and Description |
---|---|
private Component |
component |
NO_SUCH_PAGE, PAGE_EXISTS
Constructor and Description |
---|
ComponentPrinter(Component component)
Construct a new
ComponentPrinter for printing the specified
component. |
Modifier and Type | Method and Description |
---|---|
void |
print()
Print the component.
|
int |
print(Graphics g,
PageFormat pageFormat,
int pageIndex)
Implementation of the
Printable interface; this method
should not be called directly. |
void |
setComponent(Component component)
Specify a different component to be printed.
|
public ComponentPrinter(Component component)
ComponentPrinter
for printing the specified
component.component
- The component to be printed.public void setComponent(Component component)
component
- The new component.public void print() throws PrinterException
PrinterException
- If an error occurred during
printing.public int print(Graphics g, PageFormat pageFormat, int pageIndex)
Printable
interface; this method
should not be called directly.WebARTS Library Licensed Under the GNU - General Public License. Other Libraries licensed under their respective Open Source Licenses