Event Filters, Bubbling, Capturing and Custom Events
Learn Event Filters, Bubbling, Capturing and Custom Events (Phase 4 · Event Handling (Essential), JavaFX) with worked examples, diagrams and interview questions. Free on JavaSchoolLab.
Event delivery: capturing then bubbling • When an event occurs, JavaFX builds the event dispatch chain from the Stage down to the target node (root → ... → target). Delivery has two phases: capturing (event travels from the root down to the target; event filters run) then bubbling (back up from the target to the root; event handlers run). Calling event.consume() stops further propagation. This lets a parent intercept (filter) or react to (handler) events of its children.