Skip to main content

Displaying alerts

2 replies [Last post]
Joined: 2006-02-17

Hi it's me again, so soon. My next question is, I've been able to create a tray application using the jdic libraries. Now, I want to display alerts that seem to emanate from the tray. If you've used msn messenger or yahoo messenger or even azureus you'll understand. basically how can I make alerts display from my system tray icon.
Also, and this is a more difficult question for me, is there any class or source code example for displaying msn messenger type alerts in java? I'm referring to simple alerts which will display a message saying "you have 3 new e-mail messages" , that sort of thing. I don't want to use a cluncky swing JFrame to display my alerts. Also, the alerts can have an action listener so that if you click on the alert, something happens.
If this is part of the jdic project and I'm unaware of it, any pointers would be welcome.
Many thanks,

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
Joined: 2004-06-21


I've done something like you, an email client in the tray, which displays alerts whenever a message arrives. I wanted my alerts to be Messenger like as well. The only think I could do was to use a JFrame without decorations (frame.setUndecorated(true)). This removes the JFrame frame, title bar and Close/minimize/maximize buttons. Then I added some fancy background to replace the boring grey-colored background all frames have by default. I would include the code, but it is quite large and undocumented :) Besides, I don't know how to include code here and keep the indentation. You can see the resulting JFrame image here:

I'm sure you can do the same with JDialog and JWindow, so your alert won't appear in the task bar.

Hope this helps!


Message was edited by: eduardj

Joined: 2006-02-17

Thanks a lot Edu, setting it to undecorated really helped. I've been able to build something similar. Thanks