public interface EventListener
EventListener
インタフェースはイベント処理の重要な方法です。ユーザーはEventListener
インタフェースを実装し、AddEventListener
メソッドを使用してEventTarget
にリスナーを登録します。ユーザーはまた、リスナーの使用を完了したあとにEventListener
をEventTarget
から削除することも必要です。
cloneNode
メソッドを使用してNode
がコピーされても、もとのNode
に接続されたEventListener
はコピーされたNode
に接続されません。ユーザーが新しく作成されたコピーに同じEventListener
を追加する場合、ユーザーはそれらを手動で追加する必要があります。
「Document Object Model (DOM) Level 2 Events Specification」も参照してください。
修飾子と型 | メソッドと説明 |
---|---|
void |
handleEvent(Event evt)
EventListener インタフェースが登録されている型のイベントが発生するときに、このメソッドが呼び出されます。 |
void handleEvent(Event evt)
EventListener
インタフェースが登録されている型のイベントが発生するときに、このメソッドが呼び出されます。evt
- Event
にはイベントに関するコンテキスト情報が含まれる。また、イベントのフローやデフォルトのアクションを決定するときに使用されるstopPropagation
メソッドとpreventDefault
メソッドも含まれる。 バグまたは機能を送信
詳細なAPIリファレンスおよび開発者ドキュメントについては、Java SEのドキュメントを参照してください。そのドキュメントには、概念的な概要、用語の定義、回避方法、有効なコード例などの、開発者を対象にしたより詳細な説明が含まれています。
Copyright © 1993, 2018, Oracle and/or its affiliates. All rights reserved. Use is subject to license terms. Documentation Redistribution Policyも参照してください。