In SceneBuilder when you click on a ui control on the scene, the control's border become blue with anchors that you can use to dynamically resize the component.

Is this behavior built-in in JavaFx or do i have to implement it myself ? And if its the case then how can i achieve this ?

Thanks

有帮助吗?

解决方案

No, this is not a built-in behaviour of JavaFX. The idea of selecing and dragging nodes etc., in general, works like this:

  • on selection, create new nodes (or show existing nodes) that are the handles and the border around the "selected" node
  • each handle needs mouse event handlers
  • the mouse event handlers manage the resizing or dragging of the "selected" node

I hope that helps (a little) ...

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top