Setting and retrieving property values

The UnifontJ Java classes may be operated entirely by setting or retrieving Property values programmatically.

Any property may be set using a method of the form setProperty(value), eg. The Caption property may be set using

Barcode.setCaption(“12345”);

Similarly the current value of any property may be obtained using a getProperty() method, eg.

String ss=Barcode.getCaption();

These examples require that that value used to set a property or the variable used to receive a property must be of the correct type (as listed in the Properties reference).

For applets it is usually desirable to set all parameters using strings. So all properties may also be set using the setPara(PropertyName,Value) function – where both the PropertyName and the Value are Strings, e.g.

Barcode.setParam(“CAPTION”,”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.

 

 

More:

Licensing the component