Home  >  Java Barcode  >  Java Barcode Generation Guide  >  Generate Code 39 Barcode in Java Applications
Java Code-39 Barcode Generator
Java Code-39 Barcode Generator Library offers the most affordable Java barcode generator for Java professionals. It can easily generate & print Code 39 barcode in Java Class, Jasper Reports, iReport and BIRT projects.
Java Code-39 Barcode Introduction
Code 39 is also known as ANSI/AIM Code 39, ANSI/AIM Code 39, Uniform Symbology Specification Code 39, USS Code 39, USS 39, Code 3/9, Code 3 of 9, USD-3, LOGMARS, Alpha39, Code 39 Extended, and Code 39 Full ASCII.
Java Barcode Code 39 Generator - How to Generate Barcode Code-39 in Java Class?
Free sample Java code for how to generate a linear barcode Code 39 inn Java class.
BarCode barcode = new BarCode(); 

// set barcode properties
barcode.setSymbologyType(BarCode.CODE39);
barcode.setCodeText("CODE39");

// draw and generate barcode to buffered image object
BufferedImage code39Image = barcode.drawBarCode2Image();
Java Barcode Code 39 Generator - How to Generate Code-39 Barcode in Java Servlet Applicaton?
The following Java code illustrates how to generate a Code 39 barcode in Java Servlet class.
public class BarcodeServlet extends HttpServlet 
{
public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException
{
try
{
BarCode barcode = new BarCode();

// set barcode properties
barcode.setSymbologyType(BarCode.CODE39);
barcode.setCodeText("CODE39");

// draw and generate barcode to response's ServletOutputStream
ServletOutputStream servletoutputstream = response.getOutputStream();

barcode.drawBarCode2Stream(servletoutputstream);
}

catch (Exception e)
{
throw new ServletException(e);
}
}
}
Java Barcode Code 39 Generator - How to Create Code-39 Barcode Through HTTP Request?
  1. Install Java Barcode Generator Servlet application to Tomcat or JBoss. Java developers should copy barcode folder to your Tomcat application folder, and restart the Tomcat.
  2. After Tomcat restarted, open your browser and navigate to:
    http://your_tomcat_url:port/barcode/barCode?code-text=CODE39&symbology-type=5
  3. You can also insert Code 39 linear barcode in HTML or JSP page.
    <img src="http://your_tomcat_url:port/barcode/barCode?code-text=CODE39&symbology-type=5">
Java Barcode Code 39 Generator - How to Draw & Print Barcode Code-39 to java.awt.Image Object?
The following free sample Java source code shows how to generate a Code 39 barcode image in a java.awt.Image object.
private static void demoLinearBarcode() throws Exception 
{
BarCode barcode = new BarCode();

// set barcode properties
barcode.setSymbologyType(BarCode.CODE39);
barcode.setCodeText("CODE39");

// create image object
java.awt.image.BufferedImage image = new java.awt.image.BufferedImage(300,300,java.awt.image.BufferedImage.TYPE_BYTE_INDEXED );

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

// draw barcode to specified location in Rectangle
barcode.paintBarCode(imgGraphics, new java.awt.Rectangle(0, 0, 300, 300));
}
Java Code-39 Properties
Code-39 Type Value: com.keepdynamic.barcode.generator.BarCode.CODE39 (5).

Code-39 extension Type Value: com.keepdynamic.barcode.generator.BarCode.CODE39EX (6).
Links to Other Barcodes Generation in Java Application
Java Code 39 barcode generating component supports over 20 linear & 2d barcodes generation in Java projects.