如何检测一个摆动窗口是否高于另一个摆动窗口

编程入门 行业动态 更新时间:2024-10-27 13:30:17
本文介绍了如何检测一个摆动窗口是否高于另一个摆动窗口的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我在我的应用中打开了几个不相关的 JFrames 。在应用程序退出时,我应该记住所有人的偏好,以便在退出之前恢复他们的相同视图。

I have several unrelated JFrames opened in my app. And on app exit I should remember the preferences of all of them to restore them the same view they was before exit.

问题是当这些框架位于另一个之上时,它们应该以相同的顺序恢复。另一种方法是较小的框架在较大的框架下不可见。

The problem is when these frames are located one above another, they should be restored in the same order. Another way the smaller frames would not be visible under bigger ones.

问题:在这种情况下,如何检测每个帧的深度位置?

QUESTION: How can I detect the deep location each of frames in this case?

UPD:我通过比较帧的位置/大小对检测到这种情况,但我仍然不知道如何解决我的问题。

UPD: I detect this case by comparing the frames' location/size pairs, but I still do not how to resolve my issue.

UPD2:注意:几个jframes ui 不是默认状态。 默认显示一个JFrame ,但如果想要,用户 可以使用多个。我的问题不是关于如何制作单个JFrame ,但如何使用多个 。

UPD2: Note: the several jframes ui is not default state. One JFrame shown by default, but user can use several if he want. My question is not about how to make single JFrame, but how to operate with several ones.

推荐答案

只需使用 Window.isFocusableWindow(),检查哪个 JFrame 位于所有其他人之上。

Simply use Window.isFocusableWindow(), to check as to which JFrame lies on top of all others.

虽然我也坚持不使用多个 JFrame ,对于任何申请: - )

Though I will also insist on not using more than a single JFrame, for any application :-)

更多推荐

如何检测一个摆动窗口是否高于另一个摆动窗口

本文发布于:2023-11-11 06:39:57,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1577657.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:窗口   高于

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!