Example usage for javax.print PrintException getLocalizedMessage

List of usage examples for javax.print PrintException getLocalizedMessage

Introduction

In this page you can find the example usage for javax.print PrintException getLocalizedMessage.

Prototype

public String getLocalizedMessage() 

Source Link

Document

Creates a localized description of this throwable.

Usage

From source file:ru.codemine.pos.service.printer.PrinterServiceTest.java

@Test
public void testPrinterService() {

    try {/*from   ww  w .  ja va 2s .c  o m*/
        Cheque cheque = new Cheque();
        cheque.addItem(
                new Product("123456", " ? ?", "123", 1200.0), 1);
        cheque.addItem(new Product("1234576", " ? ", "1237", 2400.0),
                1);
        printerService.printPlainText(new SimpleChequeTemplate(cheque).toString(), "Star-TSP100");
        log.info("Printing: ok");
    } catch (PrintException ex) {
        log.error(ex.getLocalizedMessage());
        ex.printStackTrace();
    }
}