如何通知用户桌面应用程序的重要事件? [英] How to notify the user of important events for a desktop application?

查看:174
本文介绍了如何通知用户桌面应用程序的重要事件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们的客户正在使用我们的软件(Java Swing应用程序开始使用Webstart)以及其他软件(如MS Office)来完成他的工作。他不时会在我们的软件中处理重要事件而不会有太多延迟。客户希望获得明显的通知。现在他可能正在使用Excel,因此弹出一个消息框是不够的(尽管任务栏中的条目会闪烁)。

Our customer is using our software (Java Swing application started using Webstart) besides other software like MS Office, to do his job. From time to time there are important events he has to deal with in our software without much delay. The customer wants to have a prominent notification then. Now he might be using Excel at the moment, so popping up a message box will not suffice (although the entry in the task bar will be flashing).

我们需要一些机制,例如Outlook通知程序,即一个始终可见但不会窃取焦点的弹出窗口。通知程序应始终显示,直到消息原因消失(用户已解决问题)或用户已关闭消息(如Outlook中)。此外,我们想要显示一个托盘图标,并可能播放声音。

We need some mechanism like the Outlook notifier, i.e. a popup that is always visible but does not steal the focus. The notifier should be displayed all the time until the reason for the message has gone (the user has solved the issue) or the user has closed the message (like in outlook). Additionally we want to display a tray icon and maybe play a sound.

我已经尝试过Java6 java.awt.SystemTray以及JDIC(版本0.9,因为我们已经在该项目的类路径中具有该等效的lib,但我没有找到设置TrayIcon.displayMessage方法的超时的方法,并且该消息似乎并不总是在顶部。

I've tried the Java6 java.awt.SystemTray as well as the JDIC (version 0.9 since we already have that lib in the classpath of that project) equivalent, but I did not find a way to set the timeout of the TrayIcon.displayMessage method, and the message seems not to be always on top.

除了JNI还有其他选择来实现所请求的行为吗?

Is there any other option besides JNI to achieve the requested behavior?

如果JNI是唯一的选择,并且由于Windows是我们客户的唯一平台,Outlook通知程序是仅Outlook功能,还是可以通过Windows API自由使用?

If JNI is the only choice and since Windows is the only platform of our customers, is the Outlook notifier an Outlook only feature, or is it freely usable through the Windows API?

或者存在哪些其他选项可以通知用户在一个软件中执行的重要任务,而不会妨碍他在另一个软件中完成当前任务。因此系统模态对话框是没有选项!

Or what other options exist to notify the user about an important task to perform in one software without hindering him to complete his current task in another software. A system modal dialog therefore is no option!

推荐答案

尝试使用 setAlwaysOnTop

这篇关于如何通知用户桌面应用程序的重要事件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆