Taskbar flashing with Java (a la pidgin || MSN)

I am looking for a push in the right direction. I have a simple chat program written entirely in Java, and I'm looking for a way to make the taskbar icons blink. Preferably in a manner similar to Pidgin or MSN.

I hope for a platform-independent solution, as there are both users of Linux and Windows, and preferably completely in Java.

+7
java taskbar
source share
1 answer

Unfortunately, there is no way to do this in the standard Swing API. But you can get around it in several ways:

  • Flash icon and window title (set a timer and change it when it fires).
  • Request focus, then immediately make the window invisible; Turn the process over at your preferred interval.

Both methods are demonstrated in the forums.sun.com topic .

Alternatively, instead of blinking, you can display a message in the system tray using TrayIcon.displayMessage() ; which may or may not suit you better, but be careful that it does not work on a cross-platform platform.

+3
source share

All Articles