如何将线绑定到节点?在JAVAFX中

如何将线绑定到节点?在JAVAFX中,java,javafx,line,bind,Java,Javafx,Line,Bind,比如说, fLine.setStartX(aNode.getLayoutX()); fLine.setStartY(aNode.getLayoutY()); fLine.endXProperty().bind(bNode.layoutXProperty()); fLine.endYProperty().bind(bNode.layoutYProperty()); 我要 fLine.setStartX(aNode.getLayoutX()); fLine.setStartY(aNode.getL

比如说,

fLine.setStartX(aNode.getLayoutX());
fLine.setStartY(aNode.getLayoutY());
fLine.endXProperty().bind(bNode.layoutXProperty());
fLine.endYProperty().bind(bNode.layoutYProperty());
我要

fLine.setStartX(aNode.getLayoutX());
fLine.setStartY(aNode.getLayoutY());
fLine.endXProperty().bind(bNode.layoutXProperty()+10);
fLine.endYProperty().bind(bNode.layoutYProperty()+10);
我该怎么做呢?

你可以

fLine.endXProperty().bind(bNode.layoutXProperty().add(10));
fLine.endYProperty().bind(bNode.layoutYProperty().add(10));
你可以

fLine.endXProperty().bind(bNode.layoutXProperty().add(10));
fLine.endYProperty().bind(bNode.layoutYProperty().add(10));
你可以

fLine.endXProperty().bind(bNode.layoutXProperty().add(10));
fLine.endYProperty().bind(bNode.layoutYProperty().add(10));
你可以

fLine.endXProperty().bind(bNode.layoutXProperty().add(10));
fLine.endYProperty().bind(bNode.layoutYProperty().add(10));