且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

Java:Flash一个窗口来吸引用户的注意力

更新时间:2023-12-02 22:52:46

有两种常用方法可以做到这一点:使用JNI设置紧急提示在任务栏的窗口中,创建一个通知图标/消息。我更喜欢第二种方式,因为它是跨平台的并且不那么烦人。

There are two common ways to do this: use JNI to set urgency hints on the taskbar's window, and create a notification icon/message. I prefer the second way, since it's cross-platform and less annoying.

参见关于 TrayIcon 类的文档,特别是 displayMessage() method。

See documentation on the TrayIcon class, particularly the displayMessage() method.

以下链接可能是兴趣:

  • New System Tray Functionality in Java SE 6
  • Java Programming - Iconified window blinking
  • TrayIcon for earlier versions of Java