views:

366

answers:

4

I am creating an application that is essentially a financial alerts site. I am a basic level Java programmer, and I have created some of the logic for alerts in Java.

I want to be able to have pop-ups appear on the desktop whenever something "interesting" happens (interesting depends on %change, liquidity and a few other simple factors).

What is the best combo of technology to implement something like this?

A: 

You could write a java program that resides in the system tray, but I am not sure if there are cross platform compatible ways to do this. maybe you have to use a platform specific library for Win, Mac, Linux, ...

I'd just create a message window and animate it. Then add SystemTray support and voila, you're done.

In Delphi you can do that pretty quickly, but you can't easily reuse your java logic

Patrick Cornelissen
A: 

You can just run you program in "silent" mode, without creating any windows by default, maybe just a little icon in the taskbar which when double-clicked will open a settings window. The program will be running in the background and creating windows with the set focus whenever an event happens.

But in my opinion, a slide window or at least a balloon tooltip is a better idea.

User
+7  A: 

I would use the java.awt.SystemTray in Java SE 6. It's cross-platform and pretty easy to use.

Although some people hate the balloon notifications in Windows, they're the least obtrusive popups, since they can be ignored by the user or easily dismissed. Most importantly, they can't be missed by the user who has been away from the computer, because balloons (at least in Windows XP/Vista) use system idle timers to determine when's the right time to disappear.

Some prefer more traditional toast notifications, similar to those shown by Outlook - they show up and slowly fade out, giving the user some time to interact with them if needed.

macbirdie
Thanks, the "traditional toast notifications" are what I need. Do you know any good books or online tutorials that would help me get started.
Ankur
A: 

I had the same problem and finally solved it using an undecorated, alwaysOnTop window.

And thanks to this blog entry I found the TimingFramework, and now it even is translucent, fades in and out, goes 100% opaque on mouse over etc. In conjunction with the SystemTray and TrayIcon the behavior is nearly as that of Outlook.

Oh, I have to note, that other than the second link, I do the fading out with

AWTUtilities.setWindowOpacity(window, op);
Tobias Schulte