|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectij2x.print.PrintableDocument
public class PrintableDocument
This class implements the Pageable and Printable interfaces and allows the contents of any JTextComponent to be printed using the java.awt.print printing API.
Field Summary |
---|
Fields inherited from interface java.awt.print.Pageable |
---|
UNKNOWN_NUMBER_OF_PAGES |
Fields inherited from interface java.awt.print.Printable |
---|
NO_SUCH_PAGE, PAGE_EXISTS |
Constructor Summary | |
---|---|
PrintableDocument(javax.swing.text.JTextComponent textComponent)
This constructor allows printing the contents of any JTextComponent using a default PageFormat and a default scale factor. |
|
PrintableDocument(javax.swing.text.JTextComponent textComponent,
java.awt.print.PageFormat format,
double scalefactor)
This constructor allows the contents of any JTextComponent to be printed, using any specified PageFormat object and any scaling factor. |
Method Summary | |
---|---|
int |
getNumberOfPages()
Return the number of pages. |
java.awt.print.PageFormat |
getPageFormat(int pagenum)
Return the PageFormat object for the specified page. |
java.awt.print.Printable |
getPrintable(int pagenum)
This Pageable method returns the Printable object for the specified page. |
int |
print(java.awt.Graphics g,
java.awt.print.PageFormat format,
int pageIndex)
This is the basic Printable method that prints a specified page |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public PrintableDocument(javax.swing.text.JTextComponent textComponent)
public PrintableDocument(javax.swing.text.JTextComponent textComponent, java.awt.print.PageFormat format, double scalefactor)
Method Detail |
---|
public int getNumberOfPages()
getNumberOfPages
in interface java.awt.print.Pageable
public java.awt.print.PageFormat getPageFormat(int pagenum)
getPageFormat
in interface java.awt.print.Pageable
public java.awt.print.Printable getPrintable(int pagenum)
getPrintable
in interface java.awt.print.Pageable
public int print(java.awt.Graphics g, java.awt.print.PageFormat format, int pageIndex)
print
in interface java.awt.print.Printable
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |