I have tried again and again to move a jlabel to the position where the pointer is located. for this I have captured the coordinates of the pointer and I have assigned them to my label.
private void jPanel1MouseMoved(java.awt.event.MouseEvent evt) {
///coordenadas es un jlabel que me sirve para mostrar las coordenadas donde se encuentra el puntero
coordenadas.setText(String.format("Sus coordenadas son: [%d ,%d]", evt.getX(), evt.getY()));
x=evt.getX();
y=evt.getY();
///llegador es mi label que deceo mover a la posicion donde se encuentra mi puntero
llegador.setLocation(x,y);
}
but it turns out that the "llegador" label does not change position (it does not move). if they helped me, I would appreciate it a lot.
thanks in advance