tags:

views:

44

answers:

2

My Java application sometimes stays at system tray, just like MSN messenger does. I need popup a window to display some formated texts. Sometimes there is more than 1 message entry. I need to display them all.

I am new to jave Swing/GUI.

Anyone has idea or experience on this?

+1  A: 

I haven't had the opportunity to work with the Java system tray functionality yet, but you might be interested in reading this overview.

One particular section that appears to describe what you want is this:

Finally, if you wish to casually notify the user of a change in application status using a tooltip from the tray icon, use the displayMessage() method. This method displays a popup message near the tray icon, which will disappear after a time or if the user clicks on it. Clicking on the message may trigger an ActionEvent, depending on the platform.

That sounds like it describes what you want to do, but I'm not sure if there are any limitations on it. With that, the SystemTray and TrayIcon classes might be of interest as well, although I'm guessing that you've read them already.

Thomas Owens
+1  A: 

The system tray functionality in Java 6 allows you to do what you want. Namely have an icon there, which your application can then react to. The functionality to show a message bubble is available.

I have found that the display of multiple individual messages varies a lot between platforms, so I would group them together in a time interval and show them together instead of individual bubbles.

Have a look at http://java.sun.com/developer/technicalArticles/J2SE/Desktop/javase6/systemtray/

Thorbjørn Ravn Andersen
`SystemTray` only looks OK in windows... In Linux, it looks like a GTK app from 90's. Sad...
tulskiy