Client API. The Codename One framework your app is built on: this runs on the device, not in a backend.
public class CustomerDisplay
- Object
- 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 IOException | Clears the display. |
public void show(String top, String bottom)
throws IOException | Shows two lines, each cut or padded to the width. |
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. |
Inherited methods
Constructor details
CustomerDisplay
public CustomerDisplay(ByteLink link)Parameters
linkByteLink- the connection, usually serial or USB
Method details
setWidth
public void setWidth(int width)Characters per line. Defaults to 20.
Parameters
widthint- the display’s line width
clear
public void clear()
throws IOExceptionClears the display.
Throws
IOException- when the display cannot be reached
show
public void show(String top, String bottom)
throws IOExceptionShows two lines, each cut or padded to the width.
Parameters
topString- the first line
bottomString- the second line
Throws
IOException- when the display cannot be reached
showAmount
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.
Parameters
labelString- the item or “TOTAL”
amountString- the formatted amount
Throws
IOException- when the display cannot be reached