jimmc.swing
Class LabelPrinter

java.lang.Object
  |
  +--jimmc.swing.LabelPrinter
All Implemented Interfaces:
java.awt.print.Printable

public class LabelPrinter
extends java.lang.Object
implements java.awt.print.Printable

Layout and print labels.


Fields inherited from interface java.awt.print.Printable
NO_SUCH_PAGE, PAGE_EXISTS
 
Constructor Summary
LabelPrinter()
          Create a LabelPrinter.
 
Method Summary
 void nextLabel()
          Advance to the next label.
 void print()
          Print this set of labels.
 int print(java.awt.Graphics graphics, java.awt.print.PageFormat pageFormat, int pageIndex)
           
 void setLabelHtml(java.lang.String html)
          Set the html text for the current label.
 void setLabelsPerPage(int xCount, int yCount)
          Set the number of labels on each page.
 void setNextLabelHtml(java.lang.String html)
          Advance to the next label and set its html.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LabelPrinter

public LabelPrinter()
Create a LabelPrinter.
Method Detail

setLabelsPerPage

public void setLabelsPerPage(int xCount,
                             int yCount)
Set the number of labels on each page.

nextLabel

public void nextLabel()
Advance to the next label. Call this before setting the html text for the first label, then call it again before setting the html text for each subsequent label.
See Also:
setNextLabelHtml(java.lang.String)

setLabelHtml

public void setLabelHtml(java.lang.String html)
Set the html text for the current label.

setNextLabelHtml

public void setNextLabelHtml(java.lang.String html)
Advance to the next label and set its html. Same as calling nextLabel() followed by setLabelHtml(java.lang.String).

print

public void print()
Print this set of labels.

print

public int print(java.awt.Graphics graphics,
                 java.awt.print.PageFormat pageFormat,
                 int pageIndex)
Specified by:
print in interface java.awt.print.Printable