Hello, do you have any example on how to use this add-on? I need to implement a barcode scanner for my application.
Thank you for your help!
Hello, do you have any example on how to use this add-on? I need to implement a barcode scanner for my application.
Thank you for your help!
Hello, you can see example on code samples tab.
BarcodeScanner barcodeScanner = new BarcodeScanner(event ->{
System.out.println("data: " + event.toString());
lastScannedLabel.setText("Last scanned value: "+event.getCodeResult().getCode());
});
Label lastScannedLabel = new Label("Last scanned value: unknown");
add(barcodeScanner);
add(lastScannedLabel);
barcodeScanner.setReaders(DecoderEnum.CODE_39_READER);
barcodeScanner.setStopAfterScan(false);
add(new Button("stop",e->{
barcodeScanner.stop();
}));
add(new Button("start",e->{
barcodeScanner.initAndStart();
}));
you can put consumer into costructor and after construct object you need to call initAndStart() method.