KA.Barcode for Java
Code 128 Image Setting for Java
Generate and draw Code 128 linear barcodes with setting fixed image resolution, format, colors, rotation, etc using Java
Code 128 Barcode Generator for Java Overview
  • Supports Java Reports software to set your wanted image format, resolution, bar alignment, etc of Code 128
  • Java Client applications with Java Class, Swing, Applet, Java Bean and J2SE are supported
  • Check sum digit of Code 128 image can be automatically computed
  • Supports all common operation systems, such as Windows 7, Windows Server 2008, Windows Vista, Windows XP and Microsoft Windows Server 2003
  • Code 128 image color can be changed with setting BackgroundColor, ForegroundColor and TextColor
  • The generated Code 128 image resolution can be set to be a fixed value with your need
  • Java Code 128 generation component supports rotating Code 128 image with 0, 90, 180, 270 angles
Related Code 128 Java Generation Setting Guide
KA.Barcode Generator for Java provides complete source code on Code 128 generation which are Code 128 size setting guide in Java, Code 128 image setting guide on Java and Code 128 data encoding guide for Java:
  • Navigate to Code 128 Size Setting for Java to find more details on how to set Code 128 barcode image width, margins, barcode image height, etc;
  • Navigate to Code 128 Data Encoding for Java to find a complete source code for setting Code 128 valid data with all ACII and valid data set in proper data length.
This walkthrough will show you how to generated barcodes for ASP.NET in Visual Studio by using free C#.NET Barcode Library DLL with use-friendly...
3. Copy KeepAutomation.Barcode.Windows.dll to your Winforms project folder; (There is no need to copy .dll to ....
more>
Java Code 128 Image Setting Properties
Code 128 image can be influenced with the following properties in Java applications:
  • displayText - Set it to be true to display Code 128 image text, default is true
  • rotate - rotate Code 128 image r with 0, 90, 180 and 270 degrees
  • resolution - Code 128 image resolution in dpi (short for dot per inch) with default value 72dpi
  • backgroundColor - Code 128 barcode image background color
  • foregroundColor - Code 128 barcode image foreground color
  • textColor - Code 128 text color under the barcode
  • ApplyChecksum - to add the check sum digit after the Code 128 encoding data in the text
  • barAlignment - put the barcode in the left, right and center inside the Code 128 image
Code 128 Image Setting in Java - Implementation
Before adjusting Code 128 related image setting parameters please download and set up Code 128 generator for Java in Intellij IDEA and then encode the following source code:
//Build Code 128 barcode object in Java
BarCode barcode = new BarCode();
//Set barcode type to be Code 128
barcode.setType(IBarCode.CODE128);
//Encode Code 128 encoding code value
barcode.setData("CODE128");

Code 128 Image Resolution Setting in Java

Any Code 128 image resolution in Java can be changed to be any value for your programming need as below example:
//Set Code 128 image resolution in dpi, default value is 72
Barcode.setResolution(90);

Code 128 Image Position Setting using Java

Code 128 image position with Java can be changed with rotate (used for changing Code 128 angle) and bar alignment (used for changing Code 128 placement in the image).
//Set Code 128 rotation angle using Java
barcode.setRotate(IBarCode.ROTATE_90);
// Code 128 bar alignment in Java are valid for left, right and center with default center position
Barcode.setbarAlignment(right);

Code 128 Image Color Setting with Java

Code 128 image color cannot only be black and white but also can be colorful with your special need:
//Set Code 128 image background color in Java with default white
barcode.setbackgroundColor(blue);
//Set Code 128 image foreground color in Java with default black
barcode.setforegroundColor(white);
//Set Code 128 image text color in Java with default black, however, if the displaytext is set to be false, this property is invalid for adjustment
barcode.settextColor(white);

Text Setting for Java Code 128 Image

Text under Code 128 linear barcode image can be hided with displayText and the check sum character can also be hided if setting them to be false.
// Display human readable text
barcode.setDisplayText(true);
//Add a checksum digit to Code-39 encoding code
barcode.setApplyChecksum(true);