Events

Print Progress Event

This event is fired by the LinePrinter or LabelPrinter class during printing to inform the application when printing starts and when printing is complete.

The LabelPrinter and LinePrinter classes inherit the addPrintProgressListener method from the parent class, Printer. The application may use the addPrintProgressListener method to add an event listener to receive this event from the LabelPrinter or LinePrinter object. The addPrintProgressListener method takes an object of PrintProgressListener as the parameter.

PrintProgressListener Interface

The PrintProgressListener interface is defined as:

public interface PrintProgressListener extends EventListener

This interface contains one method:

public void receivedStatus(PrintProgressEvent aEvent)

The receivedStatus method has a PrintProgressEvent parameter that contains the event data.

PrintProgressEvent Class

This class contains the print progress event data and is defined as:

public class PrintProgressEvent extends EventObject

This class has the following methods:

public int getMessageType()

The getMessageType method returns the type of progress message that the LabelPrinter or LinePrinter object is notifying the application of. The return value is one of the constants defined in PrintProgressEvent.MessageTypes.

PrintProgressEvent.MessageTypes Class

This nested class defines the constants representing the print progress message types. The message types are defined as follows:

public static final int CANCEL
public static final int COMPLETE
public static final int ENDDOC
public static final int FINISHED
public static final int NONE
public static final int STARTDOC

CANCEL indicates printing is cancelled due to unexpected errors.

COMPLETE indicates printing is completed without errors or being cancelled.

ENDDOC indicates printing is done but the LinePrinter is not yet disconnected from the printer.

FINISHED indicates the printer connection is closed without regard to the printing status.

NONE indicates an unknown message type.

STARTDOC indicates printing has begun.