To make the dBarScanJ.class available to your Java compiler copy the jar archive or the directory structure com.dlsoft.dBarScanJ onto the classpath used by your compiler, or copy the com.dlsoft.dBarScanJ directory structure into the directory containing your applications java source files.
Be sure to include the line
Import com.dlsoft.dBarScanJ.* in your applications source code.
Before any of the dBarScanJ properties or methods can be used the class must be declared using
dBarScanJ scanner=new dBarScanJ();
Studying the source code of the sample application (scantest.java), and the com directory structure included in the build directory, illustrates a simple way in which the class can be included in an application. (The ImageFilter.java contains a class that permits selction of image files from a list of files, and the picbox.java is a class for displaying an image on a canvas and reporting the position of mouse activity)
The scantest.java and associated files may be converted to a working application by typing at a console prompt:
Javac picbox.java
Javac ImageFilter.java
Javac
scantest.java
And the application may then be run by typing
Java scantest
The demo program allows an image file to be loaded and viewed. In “Laser” mode clicking to the left of the image (i.e. in the light margin) results in a red box being drawn around the area to be scanned; in “CCD” mode draw a box with the mouse around the target barcode while holding down the left mouse button; in “Full” mode the image should contain only the barcode. In each case, pushing the Scan button will initiate a scan.
The image files scantest3.xxx contain a 300 dpi scanned image of a page containing a variety of barcodes.
Setting and retrieving property values in Java