Coordinates of an html object in webview
Is it possible to find out the position of an object on the screen via html or javascript in webview javafx?
Ex: I want to get the X and Y from the position of a button. Know exactly where it is on the screen so I can place the mouse exactly on top of it.
I know the mouse moves, I just need to get the coordinates of some object.
If you know another way you can feel free to share.
I can already get it in javascript, now I want to retrieve the variables to use in java
function myFunction() {
var div = document.getElementById('btEnvia');
var rect = div.getBoundingClientRect();
x = rect.left;
y = rect.top;
w = rect.width;
h = rect.height;
alert ("Left: " + x + ", Top: " + y + ", Width: " + w + ", Height: " + h);
}
=======================
É possível descobrir a posição de um objeto na tela via html ou javascript em webview javafx?
Ex: quero pegar o X e Y da posição de um button. Saber exatamente em qual local ele está na tela para que eu possa colocar o mouse exatamente em cima dele.
Mover o mouse já sei, só falta pegar as coordenadas de algum objeto.
Caso conheça outra forma pode ficar a vontade para compartilhar.
Já consigo pegar em javascript, agora quero recuperar as variáveis para utilizar no java