Java TrayIcon消息关闭按钮 [英] Java TrayIcon message close button

查看:93
本文介绍了Java TrayIcon消息关闭按钮的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这里真正的问题可能是,是否有更好的方法来显示Java中的桌面消息.但是...

The real question here might be if there's a better way to display desktop messages in Java. However...

我正在使用Java trayicon向桌面用户显示消息.因为他们想保持某些消息直到用户单击它们,才能使用"displayMessage"功能,因此我必须一直显示它们,直到用户单击它们并获得一个动作命令.但是,如果用户单击小关闭按钮,则不会收到操作命令.

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.

我正在linux上进行开发,但是用户是在Windows上进行的,这使测试变得更加复杂.另外,显然这不是trayicon功能的设计目的,因此,如果有更好的方法可以做到这一点,请告诉我.

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.

谢谢.

推荐答案

仅使用对话窗口,例如java.swing.JOptionPane.showConfirmDialog(...)?

What about just using a dialog window, e.g. java.swing.JOptionPane.showConfirmDialog(...)?

这里是有关此的文章: http://download.oracle .com/javase/tutorial/uiswing/components/dialog.html

Here's an article about it: http://download.oracle.com/javase/tutorial/uiswing/components/dialog.html

这篇关于Java TrayIcon消息关闭按钮的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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