Client API. The Codename One framework your app is built on: this runs on the device, not in a backend.

public class CustomerDisplay

  1. Object
  2. CustomerDisplay

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.

Constructors

public CustomerDisplay(ByteLink link)

Methods

public void setWidth(int width)Characters per line.
public void clear() throws IOExceptionClears the display.
public void show(String top, String bottom) throws IOExceptionShows two lines, each cut or padded to the width.
public void showAmount(String label, String amount) throws IOExceptionShows a label on the left of the top line and an amount on the right of the bottom line, the usual “item / total” layout.

Inherited methods

Constructor details

CustomerDisplay

public CustomerDisplay(ByteLink link)

Parameters

link ByteLink
the connection, usually serial or USB

Method details

setWidth

public void setWidth(int width)
Characters per line. Defaults to 20.

Parameters

width int
the display’s line width

clear

public void clear() throws IOException
Clears the display.

Throws

IOException
when the display cannot be reached

show

public void show(String top, String bottom) throws IOException
Shows two lines, each cut or padded to the width.

Parameters

top String
the first line
bottom String
the second line

Throws

IOException
when the display cannot be reached

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 String
the item or “TOTAL”
amount String
the formatted amount

Throws

IOException
when the display cannot be reached