• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How can i read barcode through java

 
Naveen Kumar
Ranch Hand
Posts: 35
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi

Any Body Could you please help me.
How can i read barcode through java in swing.

Regards
Naveen
 
Nathan Pruett
Bartender
Posts: 4121
IntelliJ IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This *can* be done in Java - but it has nothing to do with Swing directly.

You're going to have to read from the bar-code scanner somehow - Serial Port, USB, Parallel Port - whatever. The link gives some libraries that you will need to interface with however your specific device connects. Once you figure out how to connect to your device, you're going to need to figure out how your device communicates barcodes - again specific to the device.

Once you have a way to talk to the device connection, and a way to figure out how the device is sending you barcode information - *THEN* you're going to use Swing to write the GUI.
 
Gregg Bolinger
GenRocket Founder
Ranch Hand
Posts: 15302
6
Chrome IntelliJ IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Typically what I've seen is that the scanner devices utilizes a native driver on the OS and all the scanner really does is spit the bar code info out to whatever focused text component there is. This could be Notepad, Word, Excel, or your swing app. So you might check that as well.
 
Ulf Dittmer
Rancher
Pie
Posts: 42967
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Some libraries you may find useful when showing/generating barcodes are iText (creates PDF files containing barcodes) and barcode4j and jbarcodebean (both on SourceForge) for creating images of barcodes.
 
Tim LeMaster
Ranch Hand
Posts: 226
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yup I worked on a Java Point of Sale application that used a bar code reader. The bar code reader basically went between the keyboard and the computer and sent the bar code in as text. There are of course other bar code readers including serial port models. We actually had magnetic strip readers too and they also came in via the keyboard.

The bar code scanner came with software to produce the bar codes to put on products so we didn't need to produce or consume bar code images in Java. Just decide on the bar code number, put it in the DB for the product, print bar codes using software, bar code comes in as text from the keyboard, compare against DB.
 
Fernando Hood
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Once you have a way to talk to the device connection, and a way to figure out how the device is sending you barcode information - *THEN* you're going to use Swing to write the GUI



I have done this but am having difficult integrating the class that reads the data with the gui.
[ May 24, 2008: Message edited by: FERNANDO HOOD ]
 
bart zagers
Ranch Hand
Posts: 234
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Gregg Bolinger:
Typically what I've seen is that the scanner devices utilizes a native driver on the OS and all the scanner really does is spit the bar code info out to whatever focused text component there is. This could be Notepad, Word, Excel, or your swing app. So you might check that as well.


I have the same experience with barcode scanners. We even have developed a web application. Each scan is just put to whatever focused text component there is, just as it would come from the keyboard.
We have never written anything that "gets" the data, the scanner always "pushes" it to the application.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic