Class CustomerDisplay

java.lang.Object
com.codename1.pos.CustomerDisplay

public class CustomerDisplay extends Object

A customer-facing pole display with the Epson DM-D (ESC/POS) command set, two lines of 20 characters by default, as most VFD and LCD pole displays accept.

Its calls block; run them off the EDT.

  • Constructor Details

    • CustomerDisplay

      public CustomerDisplay(ByteLink link)
      Parameters
      • link: the connection, usually serial or USB
  • Method Details

    • setWidth

      public void setWidth(int width)

      Characters per line. Defaults to 20.

      Parameters
      • width: the display's line width
    • clear

      public void clear() throws IOException

      Clears the display.

      Throws
      • IOException: when the display cannot be reached
      Throws:
      IOException
    • show

      public void show(String top, String bottom) throws IOException

      Shows two lines, each cut or padded to the width.

      Parameters
      • top: the first line

      • bottom: the second line

      Throws
      • IOException: when the display cannot be reached
      Throws:
      IOException
    • showAmount

      public void showAmount(String label, String amount) throws IOException

      Shows a label on the left of the top line and an amount on the right of the bottom line, the usual "item / total" layout.

      Parameters
      • label: the item or "TOTAL"

      • amount: the formatted amount

      Throws
      • IOException: when the display cannot be reached
      Throws:
      IOException