see image) Consider the following code. Replace the tags  _??1_  and _??2_, respectively, by filling in the text fields below, such that the given code snippet registers an event handler for a given Scene (called scene) that, whenever the mouse enters the scene, simply prints the type and position of the corresponding mouse event on the console.

EBK JAVA PROGRAMMING
9th Edition
ISBN:9781337671385
Author:FARRELL
Publisher:FARRELL
Chapter14: Introduction To Swing Components
Section: Chapter Questions
Problem 3RQ
icon
Related questions
Question
100%

(see image) Consider the following code. Replace the tags  _??1_  and _??2_, respectively, by filling in the text fields below, such that the given code snippet registers an event handler for a given Scene (called scene) that, whenever the mouse enters the scene, simply prints the type and position of the corresponding mouse event on the console.

EventHandler<MouseEvent> mouseHandler = new EventHandler<MouseEvent>() {
@Override
// replace ??1_
public void ??1_(MouseEvent myEvent) {
System.out.println(myEvent.getEventType()
+ ": " + myEvent.getX() +
}};
scene.setOnMouseEntered (_??2_); // replace ??2_
_??1: type your answer...
_??2_: type your answer...
: + myEvent.getY());
Transcribed Image Text:EventHandler<MouseEvent> mouseHandler = new EventHandler<MouseEvent>() { @Override // replace ??1_ public void ??1_(MouseEvent myEvent) { System.out.println(myEvent.getEventType() + ": " + myEvent.getX() + }}; scene.setOnMouseEntered (_??2_); // replace ??2_ _??1: type your answer... _??2_: type your answer... : + myEvent.getY());
Expert Solution
steps

Step by step

Solved in 2 steps

Blurred answer
Knowledge Booster
Database connectivity
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT