Thursday, August 11, 2011

Executing any file or web site link using Java Code [Windows Only]

Hello Fellaws,


We as Java programmers love the flexibility of Java Language, and are enjoying the perks provided by the Java Language.


Today, I will provide u an API which will make your programming more efficient and it will extend your project's parameters.


Sometimes, as a programmer I feel that this external file should execute when my project executes or to get popularity we feel that there should be a magic JButton which can redirect the user to our profile page or our web site on the client's favorite web browser.




So, stop your searches because i am providing you an API which can execute almost every file in Windows Operating System.
P.S. I will add Linux and Mac support later.


Let me provide the API download Link
Downlaod Here


This Rav_AutoRun.jar is the API that will add magic in your projects :)


Let me provide you 3 demos using this API
Below is the list of files or web links i will open using this API


  1. Any .mp3 Song
  2. Any .docx File
  3. www.google.com
Lets Begin 

  • Import this JAR file in your project. I am using NetBeans to develop my demo code. Steps are provided to import API in your code using NetBeans
    • Right click on your project name present on left Pane of Netbeans (Under which you have your .java files etc.
    • Select Properties, in the Project Properties Frame select Libraries on left pane
    • Click on Add Jar/Folder and select the above JAR file
    • You are done with importing API in your project


  • Playing any Mp3 Song on the user's default media player using Rav_AutoRun.jar API, below is the code


P.S. I love Lucky (Jason Mraz) :P so i will execute that song ;)

  • Executing your docx file on user's default word processor using Rav_AutoRun.jar API, below is the code

  • Executing a web site link on user's default web browser using Rav_AutoRun.jar API, below is the code
Our favorite www.google.com :P 


So, Congrats now you can add this magic in your projects to increase the parameters of your project.

Thats it for this post.

Take Care

Peace

For Any Query mail me: ravjot.singh.28@gmail.com

No comments:

Post a Comment