`

JavaBean 关于Listener的命名规则

 
阅读更多

JavaBean Listener Naming Rules
Listener method names used to "register" a listener with an event source must use the prefix add, followed by the listener type. For example,addActionListener() is a valid name for a method that an event source will have to allow others to register for Action events.
Listener method names used to remove ("unregister") a listener must use the prefix remove, followed by the listener type (using the same rules as the registration add method).
The type of listener to be added or removed must be passed as the argument
Listener method names must end with the word "Listener".


addMouseListener
removeMouseListener

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics