A. Vysotskiy
A. Vysotskiy

Reputation: 15

How to get new coordinates of scene

How to get new coordinates of scene when the window of my application change position in screen.

I tryed to use it:

scene.windowProperty().addListener((val, oldValue, newValue) -> {
    System.out.println("X " + newValue.getX());
    System.out.println("Y " + newValue.getY());
});

But it not work.

Upvotes: 0

Views: 57

Answers (1)

Butiri Dan
Butiri Dan

Reputation: 1772

The documentation for xProperty and yProperty

scene.xProperty().addListener((val, oldValue, newValue) -> System.out.println("X " + newVal));
scene.yProperty().addListener((val, oldValue, newValue) -> System.out.println("Y " + newVal));

Upvotes: 4

Related Questions