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 uselayoutx,layoutydirectly on them - there other layout managers,
region,automaticallycompute child's default position usinglayoutx, inorder adjust locations of components default positions need usetranslatex,translateyvalues.
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
Post a Comment