Data Property

Determines the data used by the barcode (or the main portion of the barcode if there's an add-on).


public char[] getData()
public boolean setData(char data[])
public boolean setData(String data)



Specifies the data for the (main portion of the) barcode.

The default is "000000".


This property must be set after barcodeType has been set; any change to the barcodeType property will cause this property to change back to the default value ("000000").

The value of this property must be valid for the current barcodeType, otherwise setData will either return false or, if the throwDataError property is true, an error will be thrown instead.

If the barcode type with a fixed length uses a check character (or characters), it's not necessary to include it in the Data property, as it can be calculated. However, if you do include it, it must be correct.

Your data may contain characters native to the current barcode type (i.e. characters without corresponding ASCII codes). To distinguish these characters from normal ASCII characters, you need to add 128 to the native character code; this is also true of the get method: all native characters will be returned with 128 added to the original character codes (so subtract 128 to get the original codes).