Wellcome to RBarCode. This package contains a java applet and a java class you can use to create barcodes for you website or java application.


This section explains the main configuration parameters of the BarCode class. This class is a descendant of java.awt.Canvas and you can therefore use it in any java container.

The names in parenthesis are the names of the applet parameters.

How to create a gif or jpg file.

You can also export the barcode to a gif or a jpeg file. In order to do this you must use the following code:

note that:

Note: this feature is only available in JDK 1.2 or later.

How to create the barcode in a java.awt.Image object

The following code illustrates how you can create a barcode in a java.awt.Image object:

bc=new BarCode();
bc.setSize(400,200); // important, set size

// create image
java.awt.image.BufferedImage image = new java.awt.image.BufferedImage( bc.getSize().width,bc.getSize().height,java.awt.image.BufferedImage.TYPE_BYTE_INDEXED );

// get graphic context of image
java.awt.Graphics imgGraphics = image.createGraphics();

// paint barcode in graphics context of image
bc.paint(imgGraphics );

How to use the checkCharacter (CHECK_BAR) field:

If you are suppling the code with the check digit already calculated, you must set CHECK_CHAR to N (this is the default). If you want the software to calculate the checksum for you, you must set CHECK_CHAR to Y.

For EAN and UPC have fixed length and therefore you only have the following possibilities:


You can use BCApplet to display barcodes in your HTML pages.Some parameters of the applet have a special format:

Example of how to use the applet:

You can provide the parameters in the Applet PARAM tag or you can also do it from Javascript. For example, the following code set a new value for the barcode:

Barcodes types

The following is a short description of some of the barcode types:

At HP site you will find more information abour barcode.