1
X是好的,但奇怪的是Y被幾個像素Y座標是不準確得到控制的全球畫面時的座標
Popup resultsList = new Popup();
Bounds textFieldBounds = textField.localToScene(textField.getBoundsInLocal());
ListView lsv = new ListView();
lsv.layoutXProperty().set(0);
lsv.layoutYProperty().set(0);
resultsList.getContent().add(lsv);
Window window = textField.getScene().getWindow();
double x = window.getX();
double y = window.getY();
resultsList.show(textField,
x + textFieldBounds.getMinX(), y + textFieldBounds.getMaxY());
有沒有人有這個問題至今感動?