Class Barcode

  • All Implemented Interfaces:, java.lang.Cloneable, Component, Scope, ComponentCtrl

    public class Barcode
    extends XulElement
    Represents a barcode

    A barcode is a component to handle 1D and 2D barcode image.

    See Also:
    Serialized Form
    • Constructor Detail

      • Barcode

        public Barcode()
    • Method Detail

      • getType

        public java.lang.String getType()
        Returns the encoded and decoded type of this component. The built-in types are
        • CODE family: CODE39, CODE128, CODE128A, CODE128B, CODE128C
        • EAN family: EAN13, EAN8, EAN5, EAN2
        • ITF family: ITF14, ITF
        • MSI family: MSI, MSI10, MSI11, MSI1010, MSI1110
        • others: UPC, PHARMACODE , CODABAR, QR
        Some of the types have character and length limit. You can check it at

        Default: "CODE128".

        A value of the barcode current type.
      • setType

        public void setType​(java.lang.String type)
        Sets the encode and decode type of this component. Example: type="code128", type="qr"
        type - decide the render type function.
      • getValue

        public java.lang.String getValue()
        Returns the value of the barcode image.

        Default: "".

        The barcode's value
      • setValue

        public void setValue​(java.lang.String value)
        Sets the value that will be encoded to the barcode image.
        value - The value to be encoded into barcode.
      • getDisplayValue

        public boolean getDisplayValue()
        Returns the visibility of the value of barcode component (only for 1D barcode).

        Default: false.

        true if displaying value is enable.
      • setDisplayValue

        public void setDisplayValue​(boolean displayValue)
        Sets the visibility of the value of barcode component.
        displayValue - Whether to show the value text or not, only for 1D barcode.
      • getFontSize

        public int getFontSize()
        Returns the fontSize of barcode (only for 1D barcode).

        Default: 10.

        the font size of the barcode text.
      • setFontSize

        public void setFontSize​(int fontSize)
        Sets the fontSize of barcode.
        fontSize - The fontSize of the barcode text, only for 1D barcode.
      • getBarWidth

        public int getBarWidth()
        Returns the width of single bar (only for 1D barcode).

        Default: 2.

        the single bar width
      • setBarWidth

        public void setBarWidth​(int barWidth)
        Sets the width of single bar.
        barWidth - The single width of the 1D barcode bar. It would affect the total width of the barcode;