This week's book giveaway is in the Programmer Certification forum.
We're giving away four copies of OCP Oracle Certified Professional Java SE 21 Developer Study Guide: Exam 1Z0-830 and have Jeanne Boyarsky & Scott Selikoff on-line!
See this thread for details.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
  • paul wheaton
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Henry Wong
Saloon Keepers:
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Tim Moores
  • Mikalai Zaikin
Bartenders:
  • Frits Walraven

How can i read barcode through java

 
Ranch Hand
Posts: 35
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi

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

Regards
Naveen
 
Bartender
Posts: 4121
IntelliJ IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Ranch Hand
Posts: 15304
6
Mac OS X IntelliJ IDE Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Ranch Hand
Posts: 226
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 ]
 
Ranch Hand
Posts: 234
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Squanch that. And squanch this tiny ad:
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic