如何隐藏基于NetBeans平台的应用程序?

发布于 2024-10-08 13:21:51 字数 130 浏览 0 评论 0原文

我指的不是无 GUI 应用程序。我正在尝试将基于 NetBeans 平台的应用程序作为系统托盘应用程序。我能够很容易地完成系统托盘部分,但我在尝试找出如何隐藏/显示 GUI 时遇到了问题。同时我会继续查看 API。

有什么想法吗?

I'm not referring to a GUI-less application. I'm trying to have an application based on the NetBeans platform as a System Tray application. I was able to do the System Tray part quite easy but I'm having issues trying to figure out how to Hide/Show the GUI. I'll keep looking in the API meanwhile.

Any ideas?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

我是有多爱你 2024-10-15 13:21:51

WindowManager.getDefault().getMainWindow().setVisible(true/false) 应该可以隐藏和显示整个 GUI,除非它有多个窗口(纯 Swing Frame.getFrames() 应该为您提供所有基于 JFrame 的窗口,如果有帮助的话) )。

如果您希望在启动时隐藏主窗口,不确定这是否能解决问题(但如果它是一个非常简单的 UI,就像许多托盘应用程序一样,您也许可以使用WindowManager 的极其简单的实现,例如 WindowManager.Trivial 并完全忽略标准 NetBeans 窗口系统)。

WindowManager.getDefault().getMainWindow().setVisible(true/false) should work to hide and show the entire GUI, unless it has multiple windows (pure Swing Frame.getFrames() should give you all JFrame based windows, if that helps).

Not sure if that will solve the problem if you want the main window hidden on startup (but if it is a very simple UI, as is true of many tray apps, you might be able to just work with a dead-simple implementation of WindowManager such as WindowManager.Trivial and leave out the standard NetBeans windowing system entirely).

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文