我可以使用本机系统窗口作为父窗口使 JDialog 成为模式吗?

发布于 2024-11-27 13:29:48 字数 77 浏览 3 评论 0原文

我有一个 JDialog 窗口。 我需要使其成为模态窗口,但父窗口不是 Java 窗口,而是本机 Windows 操作系统窗口。 是否可以?

I have a JDialog window.
I need to make it modal, but the parent is not Java window, but native Windows OS window.
Is it possible?

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

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

发布评论

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

评论(1

贪了杯 2024-12-04 13:29:49

不,你不能。您甚至无法不仅引用本机窗口,甚至无法引用在其他 JVM 中运行的 java 应用程序创建的窗口。

但是您可以创建虚拟窗口(Window,而不是 Frame 或 JFrame),将其大小设置为 0 并将其用作任何对话框的父窗口。我不知道你的具体问题是什么,但有时我提到的方法可能会有所帮助。

No, you can't. You cannot even achieve reference not only to native windows but even to windows created by java application running in other JVM.

But you can create dummy window (Window, not Frame or JFrame), set its size as 0 and use it as an parent to any dialog. I do not know what is your concrete problem but sometimes the way I mentioned may help.

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