1

I have developed a Point of Sale (POS) system in Java.

Now I want to implement bar code functionality in the program: like I purchase a bar code scanner and want to implement it with my program, and also to generate bar codes.

Is it possible?

Andrew Thompson
  • 168,117
  • 40
  • 217
  • 433
junaidp
  • 10,801
  • 29
  • 89
  • 137
  • Depending on your scanner, you could set up your program to read directly from it (rather than as a keyboard wedge - requiring input focus first) here's an [example](http://stackoverflow.com/questions/8146840/barcode-scanner-implementation-on-java). – egerardus Jan 10 '12 at 00:27

2 Answers2

3

You can use this open source library. zxing

sudmong
  • 2,036
  • 13
  • 12
3

Many barcode scanners appear indistinguishable from USB keyboards from the perspective of Java. So a barcode scan "looks like" a bunch of very rapid key events. (It's a non-trivial exercise to sort the scans from the "normal" keystrokes, so this has ramifications on the design of your user interface.

Burleigh Bear
  • 3,274
  • 22
  • 32