Barcode generation in java
barcode, java, swing
Solution
Your application is returning a text because you have told it to get the text not the bar-code.
Try the following code:
a=jTextField24.getText();
Code39 barcode=new Code39();
barcode.setData(a);
ImageIcon icon = new ImageIcon(barcode.drawBarcode());
jLabel34.setIcon(icon);
Problem
I am making an application to generate barcodes, but it does not give me the barcode: the application returns the text that I have provided. My code is: ``` Code39 code39=new Code39(); String outputStr=code39.encode("12345678", 1); String humanTextStr=code39.getHumanText(); jLabel1.setText(outputStr); jLabel1.setFont(new java.awt.Font("CCode39_S3",java.awt.Font.PLAIN,24)); ``` Please can anyone tell me why this happens?