This technical tip shows how to create a sample mobile application in Netbeans IDE to generate a barcodeimage. We will provide a textbox for getting the codetext value, generate a Pdf417 2D barcode image and display it on the mobile screen.
Open Netbeans IDE and create a new mobile device application. Please refer to Setting the Environment for preparing the development environment and adding reference to Aspose.BarCode.J2ME.jar package. We will use this textbox to get the codetext from screen for generating the barcode.
For rendering the barcode image on screen, we will use a custom item. For this purpose, we will create a new class which will extend from “CustomItem” class. This class will add an image on the screen area and render the barcode image to the display. Public methods will be added in this class to generate and render the barcode image from the application. Below is the complete code for this class. Add this class to your sample project, by copying the code.