简体   繁体   English

Java AWT Window 管理、用户输入和焦点?

[英]Java AWT Window management, user input, and focus?

I'm trying to hunt down the source of a bug that relates to window management, and possibly awt specifically.我正在尝试寻找与 window 管理相关的错误的来源,并且可能专门针对 awt。 However, I have little to no familiarity with window management in general, or awt, so I'm even sure what I searching for.但是,我对一般的 window 管理或 awt 几乎不熟悉,所以我什至确定我在寻找什么。 I'm hoping for some general guidance on terminology or otherwise that might help guide me in the correct direction.我希望对术语或其他方面有一些一般性的指导,这可能有助于指导我朝着正确的方向前进。

In the program I am working on, the user can open windows that can be interacted with (ie they have text input boxes, drop down menus, etc) and windows that cannot be interacted with (ie they just display dialog).在我正在开发的程序中,用户可以打开可以与之交互的 windows(即它们有文本输入框、下拉菜单等)和无法与之交互的 windows(即它们只是显示对话框)。 When the user opens a "non-interactive" window, the user can still use the underlying program.当用户打开一个“非交互式”window,用户仍然可以使用底层程序。 However, when an "interactive" window is opened, the user is blocked from using the underlying program until the window is closed.但是,当打开“交互式”window 时,会阻止用户使用底层程序,直到 window 关闭。 Additionally, "interactive" windows seem to stack themselves on top of "non-interactive" windows.此外,“交互式”windows 似乎叠加在“非交互式”windows 之上。 That is to say, if I open a "non-interactive" window and then open an "interactive" window after, the "interactive" window will place itself on top of the "non-interactive" window and won't allow the user to use any of the title bar widgets. That is to say, if I open a "non-interactive" window and then open an "interactive" window after, the "interactive" window will place itself on top of the "non-interactive" window and won't allow the user使用任何标题栏小部件。 In this program, this behavior is not always desirable.在这个程序中,这种行为并不总是可取的。

I assumed that this would have something to do with focusing, but I read through this document without much luck (this could be that I just don't know what I'm looking for).我认为这与聚焦有关,但我通读了这份文档并没有太多运气(这可能是我只是不知道我在寻找什么)。 Particularly, I noticed the mention of "VetoableChangeLister" which doesn't seem to appear anywhere in the code I'm working with, as well as the method "requestFocusInWindow", which does appear in the code I'm working with but not in any way that I could see that relates to my above problem description.特别是,我注意到“VetoableChangeLister”的提及,它似乎没有出现在我正在使用的代码中的任何地方,以及方法“requestFocusInWindow”,它确实出现在我正在使用的代码中但没有出现在我能看到的任何与我的上述问题描述有关的方式。

Would the above problem be related to window focusing?上述问题是否与 window 对焦有关? Or am I barking up the wrong tree here?还是我在这里吠错了树? If nothing else, even some basic terminology so I can at least Google search intelligently.如果不出意外,即使是一些基本术语,我至少可以智能地谷歌搜索。

The question I was asking relates to the "modality" of windows and was answered in the comments.我问的问题与 windows 的“模态”有关,并在评论中得到了回答。 The link provided explaining modality is https://docs.oracle.com/javase/tutorial/uiswing/misc/modality.html提供解释模式的链接是https://docs.oracle.com/javase/tutorial/uiswing/misc/modality.html

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM