在 Windows 系统托盘中隐藏我的程序
我希望我的程序在 Windows 时钟附近的任务栏状态区域中显示一个图标,并找到了一种方法来实现这一点。
问题是,如果在窗口上按下“X”,我希望我的程序在状态区域中保持打开状态,而不是在系统托盘中,但我不知道如何做到这一点,并且在 Google 上搜索也没有没有帮助(我可能没有搜索正确的术语)。
编辑:我认为我使用了错误的术语。我知道如何将程序的图标显示在通知区域中,我想要的是将其隐藏在最小化窗口时通常显示的区域中。
I'd like my program to display an icon in the TaskBar Status Area near the clock in Windows and found a way to do so.
The thing is, I'd like my program to stay open in the Status Area if the "X" is pressed on the window, but not in the System Tray, but I have no idea how to do so and searching on Google didn't help (I'm probably not searching the right terms).
Edit: I think I used the wrong terms. I know how to have my program's icon in the notification area, what I'd like is to hide it in the area where it is normally displayed when you minimize a window.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
然后不要使用系统托盘。
Then don't use the system tray.
JavaSE v 6 中添加了系统托盘支持。
您可以在此处查看示例
http://download.oracle.com/javase/7 /docs/api/java/awt/SystemTray.html
System Tray support was added in JavaSE v 6.
you can see example here
http://download.oracle.com/javase/7/docs/api/java/awt/SystemTray.html
我猜您希望在最小化主窗体时删除任务栏按钮。您可以通过将其可见属性设置为 false 来实现此目的,但是您可以使用 Java 框架来实现此目的。
I guess you want the taskbar button to be removed when you minimise the main form. You achieve this by petting its visible property to false, however you do that with your Java framework.