简体   繁体   English

侦听器层次结构

[英]Listeners hierarchy

I am wondering what is the listeners hierarchy in Java. 我想知道Java中的侦听器层次结构是什么。

For example, when I set two listeners like onFocusChange and onClick (those are just examples), which one will fire first? 例如,当我设置两个侦听器(例如onFocusChangeonClick (这些只是示例))时,哪个首先触发?

Can someone answer that question? 有人可以回答这个问题吗?

Nobody can answer this question as there are no provisions what the order is. 没有任何人可以回答这个问题,因为没有任何规定。

An implementation is free to fire the listeners in any order. 一个实现可以随意以任何顺序激发侦听器。

You can read the souce code of the class to get the concrete order for a certain implementation. 您可以阅读该类的源代码以获取特定实现的具体顺序。

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

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