positioning - JavaFX: How to position a component/node? -


in javafx, there similar setlayout(); or setbounds();?

for example, want positioning button position desire.

everything on javafx scene graph node. each node has x-coordinate , y-coordinate. there different ways set/change position of child component. depends on layout manager used show component on scene graph.

  • there layout managers, group, not compute child's default position , can use layoutx , layouty directly on them
  • there other layout managers, region, automatically compute child's default position using layoutx , inorder adjust locations of components default positions need use translatex , translatey values.

from docs :

if node managed , has region parent, layout region set layoutx according own layout policy. if node unmanaged or parented group, application may set layoutx directly position it.


Comments