问题
Is there a way to modify a polygon in JavaFX? For example if I have a triangle and I press and then drag a point from that triangle, the triangle will modify with the new coordinates of the point.
回答1:
- Layer some control nodes over the corners of the polygon.
- Attach appropriate event handlers to the control nodes so that they can be dragged around.
- Modify the polygon's points as the control node is moved (using change listeners attached to each of the control node's location properties).
Here is a sample solution.

I derived this solution from: CubicCurve JavaFX
来源:https://stackoverflow.com/questions/15981274/javafx-modify-polygons