How to make fancy notification messages appear on the desktop using JTelegraph

Hi There,

Greetings. I know its been a long time since my last post. I am sorry; I was busy and couldn’t work on my projects (which I believe are way more cooler than the work I do everyday at office.. 😛 ).

Anyway today I will show you how to bring out fancy notifications on your desktop. (You know, like the ones which microsoft outlook throws up whenever you recieve a mail).

I was building a software that would do the work which I do everyday at office, (Yeah I don’t believe in all that smart-working concept; I work hard instead to build a smart app that would do my work… 😀 )

Lets get started. I have given below the steps to bring out these awesome notifications on your desktop.

Step 1:

First of all to throw fancy (and colorful) notifications on your desktop we use JTelegraph a Java message notification library. You need to get 3 jar files namely,

1) JTelegraph; which is available here – http://sourceforge.net/projects/jtelegraph/

2) Jcarrierpigeon; which is available here – http://sourceforge.net/projects/jcarrierpigeon/

3) Timing framework; which is available here – https://java.net/projects/timingframework/downloads/directory/classic

Step 2:

Open a new java project in eclipse or netbeans and add the 3 library files to the project by following the below steps (if you are using eclipse):

Right click on the project –> properties –> Java build path –> Under the libraries tab click on the add external jars button and add the 3 jar files which you downloaded.

Step 3:

Copy paste the below code into your project.

package ;
import net.sf.jcarrierpigeon.WindowPosition;
import net.sf.jtelegraph.Telegraph;
import net.sf.jtelegraph.TelegraphQueue;
import net.sf.jtelegraph.TelegraphType;

public class Msgnotifitest {

public static void main(String[] args) {
Telegraph tele = new Telegraph("Fancy notification", "Wow this is cool", TelegraphType.NOTIFICATION_DONE, WindowPosition.BOTTOMRIGHT, 2000);
TelegraphQueue q = new TelegraphQueue();
q.add(tele);
}
}

Step 4:

Thats it; now run the application and you should see a notification on the bottom right corner of the screen.

Capture

 

Wow.. you did it.. Now you could get these cool alerts from your java application. This is especially handy when you write an application that is monitoring some other task and keeps reporting to you in a timely manner.

If you face any problem in doing the above steps kindly drop me a comment and I will help you out.

Also note that, I have used TelegraphType.NOTIFICATION_DONE in the above example. There are a lot of other cool, colorful notifications as well. Explore them yourself; after all the sky is the limit. 😀

Finally a word of thanks to the author of JTelegraph; Paulo Roberto Massa Cereda, thanks to you sir

for providing us with such a nice library.

Keep coding; Keep rocking…!! Live long and prosper..!! Peace