|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectinfo.jonclark.print.LinePrinter
public class LinePrinter
Taken from "TextPrinter" at http://experts.about.com/q/Java-1046/Print-Simple-Text-File.htm
| Field Summary | |
|---|---|
static String |
DEFAULT_FONT_NAME
Default type name, Serif |
static int |
DEFAULT_FONT_SIZE
Default font size, 12 point |
| Fields inherited from interface java.awt.print.Printable |
|---|
NO_SUCH_PAGE, PAGE_EXISTS |
| Constructor Summary | |
|---|---|
LinePrinter()
Create a TextPrinter object with the default type font and size. |
|
LinePrinter(String name,
int size)
Create a TextPrinter object ready to print text with a given font and type size. |
|
| Method Summary | |
|---|---|
boolean |
doPrint(String[] header,
String[] body,
boolean interactive)
Print some text. |
int |
getCharsPerLine()
Initialize the print job, and return the base number of characters per line with the established font size and font. |
static void |
main(String[] args)
Main method for testing. |
int |
print(Graphics graphics,
PageFormat pageFormat,
int pageIndex)
Perform printing according to the Java printing model. |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final int DEFAULT_FONT_SIZE
public static final String DEFAULT_FONT_NAME
| Constructor Detail |
|---|
public LinePrinter()
public LinePrinter(String name,
int size)
| Method Detail |
|---|
public int getCharsPerLine()
public boolean doPrint(String[] header,
String[] body,
boolean interactive)
throws PrinterException
PrinterException
public int print(Graphics graphics,
PageFormat pageFormat,
int pageIndex)
throws PrinterException
print in interface PrintablePrinterExceptionpublic static void main(String[] args)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||