Center components via alignment

41 views
Skip to first unread message

dsirijus

unread,
Jun 12, 2011, 6:23:54 AM6/12/11
to minima...@googlegroups.com
Why wouldn't the following code

_vBox = new VBox(this);
_vBox.setSize(stage.stageWidth, stage.stageHeight);
_vBox.alignment = VBox.CENTER;
_hBox = new HBox(_vBox);
_hBox.setSize(stage.stageWidth, stage.stageHeight);
_hBox.alignment = HBox.MIDDLE;
_progressBar = new ProgressBar(_hBoy);

align the _progressBar to center stage?

Keith Peters

unread,
Jun 12, 2011, 8:58:19 AM6/12/11
to minima...@googlegroups.com

The width of a vbox is the widest child. Same with height of hbox. Setting it to the stage size has no effect.

Reply all
Reply to author
Forward
0 new messages