Top Posters
Since Sunday
w
5
a
3
j
2
a
2
t
2
u
2
r
2
j
2
j
2
l
2
d
2
y
2
New Topic  
Suedyso Suedyso
wrote...
Posts: 371
Rep: 0 0
4 years ago
Fill in the code in the underlined location to display the mouse point location when the mouse is pressed in the pane.

import javafx.application.Application;
import javafx.scene.Scene;
import javafx.scene.layout.Pane;
import javafx.stage.Stage;

public class Test extends Application {
@Override // Override the start method in the Application class
public void start(Stage primaryStage) {
Pane pane = new Pane();
________

Scene scene = new Scene(pane, 200, 250);
primaryStage.setTitle("Test"); // Set the stage title
primaryStage.setScene(scene); // Place the scene in the stage
primaryStage.show(); // Display the stage
}

/**
* The main method is only needed for the IDE with limited JavaFX
* support. Not needed for running from the command line.
*/
public static void main(String[] args) {
launch(args);
}
}


▸ pane.setOnMouseClicked((e) -> System.out.println(e.getX() + ", " + e.getY()));

▸ pane.setOnMousePressed(e -> System.out.println(e.getX() + ", " + e.getY()));

▸ pane.setOnMouseReleased(e -> {System.out.println(e.getX() + ", " + e.getY())});

▸ pane.setOnMouseDragged((e) -> System.out.println(e.getX() + ", " + e.getY()));
Textbook 
Introduction to Java Programming, Comprehensive Version

Introduction to Java Programming, Comprehensive Version


Edition: 10th
Author:
Read 88 times
1 Reply
Replies
Answer verified by a subject expert
coltonf1coltonf1
wrote...
Posts: 392
4 years ago
Sign in or Sign up in seconds to unlock everything for free
More solutions for this book are available here
1

Related Topics

Suedyso Author
wrote...

4 years ago
This helped my grade so much Perfect
wrote...

Yesterday
You make an excellent tutor!
wrote...

2 hours ago
Thanks
New Topic      
Explore
Post your homework questions and get free online help from our incredible volunteers
  1232 People Browsing
Related Images
  
 397
  
 192
  
 324
Your Opinion
Which 'study break' activity do you find most distracting?
Votes: 824