Professional Documents
Culture Documents
Quick_links... Search site Trial products Online tutorials Products Barcodes for Office Barcode creators Barcode fonts Developer tools Label printing Labelling tools Windows Phone Resources New to barcodes? How To ... Support centre Tutorial centre Which product For users Common problems What's New? Newsletter Online registration Contact us
Barcodes in Java
dBarcode Java Classes are platform-independent Java classes that allow barcode images to be created within a developer's own Java desktop application, applet or servlet. Each product includes the class file, a JavaBean archive, and samples with source code illustrating a desktop application, an applet and a servlet. The classes are designed to work with, and the sample source code is provided for the Java 2 SDK J2SE 1.5 or later, and the J2EE SDK 1.5 (for the servlet). Products are suitable for use with BEA WebLogic Server, IBM WebSphere and Sun Java System Application Server.
For applets and servlets it is usually desirable to set all parameters using strings. So all properties may also be set using the setParam(PropertyName,Value) function where both the PropertyName and the Value are Strings, e.g. Barcode.setParam(DATA,123456); Using the former method the CodeType property may be set using Barcode.setCodeType(2); Or Barcode.setParam(CODETYPE,2); In these examples the property names are shown in upper case, but the Property name parameter in the setParam() method is actually case-insensitive.
} catch (IOException e) { } }
Applet development
The sample applet included with the distribution is very bare bones, and the source code is provided simply as a starting point for developers who wish to make a more advanced applet. Examination of the source code of dbcappXX.java in the build directory will illustrate how easy this is. The init() function is the ideal place to set default barcode parameters. A developer-created applet.class together with the dBarcodeXX.class may be formed into a jar archive for easy deployment using a command of the form Jar cfm myapplet.jar myapplet.class com.dlsoft.dBarcodeXX.dBarcodeXX.class
Servlet development
Servlets run on a server and return html and/or graphic code to a web browser in response to a request from the browser. The simple servlet (dbcservXX.java) accepts data from a browser either through the POST method (as when a submit button is pressed on a browser-displayed form and the browser POSTs the forms parameters back to the server), or through the GET method - when a URL linked from the browser page contains additional parameters, such as: <IMG src=http://localhost/servlet/dbcserv128?CODETYPE=0&DATA=12345678> In this case the servlet returns a image a Portable Network Graphic (PNG) image using the code in the sample servlet. See samples.
Home | About | Contact | FAQs | Information Links | News | Pictures | Products | Services | Site Map | Support Copyright 2010 DL Technology Ltd. All Rights Reserved.
Site operated by DL Technology Ltd, a company registered in England, number 3615271