AFAIK, most barcode scanners have a keyboard emulation mode. You can connect the scanner to your computer, scan the barcode, and the scanner will provide you with barcode information that mimics the usual keystrokes that you can capture in any acceptable way (for example, like keypresslistener or inputfield in Java Swing).
Konstantin V. Salikhov
source share