Java TrayIcon 消息关闭按钮
这里真正的问题可能是是否有更好的方法在 Java 中显示桌面消息。但是...
我正在使用 Java 托盘图标向桌面用户显示消息。因为他们希望保留某些消息直到用户单击它们,所以为了使用“displayMessage”功能,我必须继续显示它们,直到用户单击它们并且我收到操作命令。但是,如果用户单击小关闭按钮,我不会收到操作命令。
我在linux上开发这个,但用户在windows上,这使测试变得复杂。另外,显然这不是托盘图标功能的设计目的,所以如果有更好的方法来做到这一点,请告诉我。
提前致谢。
The real question here might be if there's a better way to display desktop messages in Java. However...
I'm using the Java trayicon to display messages to a desktop user. Because they want to keep certain messages up until the user clicks on them, in order to use the 'displayMessage' feature, I have to keep displaying them until the user clicks on them and I get an action command. However, if the user clicks on the little close button, I don't get an action command.
I'm developing this on linux, but the users are on windows, which complicates the testing. Also, obviously this isn't what the trayicon functionality was designed for, so if there's a better way to do this, let me know.
Thanks in advance.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
只使用对话框窗口怎么样,例如
java.swing.JOptionPane.showConfirmDialog(...)
?这是一篇关于它的文章: http://download.oracle.com/ javase/tutorial/uiswing/components/dialog.html
What about just using a dialog window, e.g.
java.swing.JOptionPane.showConfirmDialog(...)
?Here's an article about it: http://download.oracle.com/javase/tutorial/uiswing/components/dialog.html