Reputation: 3222
I dont want to use a gridpane.
So I have an HBox:
HBox fooBar = new HBox();
fooBar.setHeight(100);
fooBar.setWidth(100);
fooBar.setAlignment(pos.BOTTOM_LEFT);
I gave it a color in css.
I include it into my scene and for some reason the box stays stuck on the bottom left corner. Is there any way to position it?
I forgot to mention: this hbox is the child of another hbox where I didnt define any position or dimension.
Upvotes: 0
Views: 2060
Reputation: 494
Hbox is a component which determine position own children. If you want change position you should change alignment property in parent. It impact for all children. You couldn't change position for one child. All children have to be obedient.
You can use Pane for absolute positioning.
Upvotes: 1