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.

January 30, 2014

how to install java on windows computer

What is java?




Java is a cross platform, object oriented, concurrent computer programming language.It was designed by Sun microsystems in 1995.Now it maintain by Oracle corporations.

What should know before install java?

We can find e types of packages in java.[ java ME(micro edition) ,java SE(standard edition) , java EE(enterprise edition)].
Generally  we use java SE for software development.
When you downlaod java  there are 2 types you can find.
                   jdk-java development kit
                   jre-java runtime environment

Above diagram show you jdk is  a all inclusive package.I use java SE jdk package for installation.

1st Step


Go to this link and download jdk package which is matching to your system.Consider Operating system,bit version and jdk version.

2nd Step


Install application and reboot your computer.Now you can open command prompt by typing cmd in run place.Now type javac and press enter.It shows  you an error message.That is why you cant run any java code in any place without changing  environmental variables.You can run java codes in bin folder in your java installed place.

3rd Step


Now go to
My Computer ->Properties ->Advanced ->Environment Variables.
Then go to user variables and find path variable.Select it and then select edit.Now you can see variable name and variable value.there can be already value but some time free text box.Now go to java bin folder and copy and paste  it in field of value.
Ex-   ;C:\Program Files\Java\jdk1.7.0\bin .Now put a semicoalan before C if only pre values there.
Do same thing to the system variables.



After all press ok and reboot your computer.
Now get command prompt and type javac and press enter.If your java is working properly you can see this list.Now you can compile your java programmes at any place you want.


See you again next time.







January 28, 2014

how to install PHP,Mysql & Apache on windows computer

how to install PHP,Mysql & Apache on windows computer



In this post i simply explain you how to install php,mysql and apache on your windows computer.If you going to start learning php first you want to install this to see outputs of your php codes because php is only interpret in servers.Follow these steps.

1st Step
First go to one of these below link and download software package which match with you Os (XP,7or 8)and bit version(32bit or 64bit).These are free packages.

          1.WAMP server-Click on this link

         2.EasyPhpDeveloper - Click on this link

2nd Step

Install software and reboot your computer.Then run the application.Go to the task bar and right click on application icon.There you can find options call Administration, Localhost, Restart server and etc.

3rd Step

If server is always offline or local host is not working,there can be several reasons.

    1.Software package may not match with your system.

    2.ERROR-Not Found
HTTP Error 404. The requested resource is not found.
reason-Your port 80 is actually used by:
Server: Microsoft-HTTPAPI/2.0To overcome or resolve this error 
  • Type RegEdit on run or search place of your os and run that small programme.
  • Then in opened window go HKEY_LOCAL_MACHINE -> SYSTEM -> CurrentControlSet -> Services -> HTTP
  • Then change the value 3 in start text field to value 4. (3 means enable 4 means disabled.you want to disable that start.)
  • Reboot system and try to make your server online again.



    3. Some files may have lost on your System32 directory.( like msvcr110.dll )

Directly search missing file name on google and you can find that easily.download and place it in system32 directory.

Tips


  • Open a notepad file and code <?php phpinfo(); ?> and save it  as MyFirstPhpFile.php in my computer D:/testbox/. 
  • Turn on your server and go to local host. Then type clear path for your php code (ex- D:/testbox/MyFirstPhpFile.php) and hit enter.
  • If it show you a huge window with php logo, It means your php,mysql and apachy is working properly.

Thank you .See again soon.