December 25, 2014

Create a clock using Java for your application. Clock will display on jlabel.

Create a clock using Java for your application

This code is to indicate system time on your application.This code is depending on your system time while startup the application and then it do feather calculations and counting to maintain accurate time.

This time function can simply  embed to a jlabel.

December 24, 2014

December 21, 2014

Programme VFD Display using java source code. Using RXTX drivers.

Programme VFD  display using java source code

This post is about how to program VFD display using java.This code is specified for COM port.Here you need to download hardware acceleration supports from external supports.Follow given steps and refer the correct documentation related to your vfd device and replace correct byte code for given functionalities.

STEP 1: 
This VFD Customer Display has Serial cabel.So Download serial port drivers from this link 
http://sangon.altervista.org/bin/mfz-rxtx-2.2-20081207-win-x86.zip

STEP 2: 

 Unzip archive file and read instructions inside install.txt file. Follow instructions and copy files into mentioned directories.

STEP 3:

 If you use IDE like netbeans or eclips, Import RXTXcomm.jar file into lib or library folder. 

STEP 4:

 Now your computer is ready to run this class.Now install you customer display manufacture's driver package.Restart your computer.

STEP 5: 

Now you had to configure your display's basic settings for COM1.
    Baud Rate:          9600
   Data Bits:            8
   Parity:                None
   Stop Bits:           1
   Flow Control:   None
For that you can use driver application or switch system of display.
STEP 6:  
 Undestanding command mode.
basic command modes:                            1.   EPSON ESC/POS
                                                                    2.   EMAX (AEDEX)
                                                                    3.   UTC
                                                                    4.   ADM787/788
                                                                   5.   CD5220
                                                                   6.   DSP-800 (optional)
Here we use EPSON ESC/POS command system.First download user manual of your display.Inside manual you can find commands relevent to your display.
Ex: show timer on display Hex code :  1F  55
we need to convert this hex code to byte array like this 
byte time [ ]={0x1F,0x55};
STEP 7:
Download Display.java file and ESC/POS.java file from github and execute your programe.
STEP 8:
Enjoy java programming.


I like to expand this tutorial to tell you how to program a USB display.Please see the below code.
credit : CristianoGhersi

December 20, 2014

How to Print using java source code

How to print using java source code
This java class enable you to print documents or receipts easily.You can customize this class to print A4,A3,Letter and other sizes.Try this class to integrate printing function to your java application.

It is free to try this class.Enjoy java.Share java.