VBox is a JavaFX layout pane that lays out its children in a single vertical column.
Questions tagged [vbox]
158 questions
25
votes
2 answers
JavaFX HBox Alignment
I've been working on a software using JavaFX and I have a stupid but worrying problem.
In certain part of the code I have a HBox, and, inside of it three items: an image, a label and a VBox.
The issue is that I would like to have the image aligned…

Josemafuen
- 682
- 2
- 16
- 41
22
votes
3 answers
16
votes
2 answers
Get the height of a node in JavaFX (generate a layout pass)
How to get the height or prefer height of a node in JavaFX, I have 3 VBox and I want to add nodes to the the most freer panel, example:
Childrens Total Height of the children's(Sum)
VBoxA 5 890
VBoxB …

iconer
- 287
- 1
- 4
- 13
11
votes
2 answers
how to evenly distribute elements of a JavaFX VBox
Im working with a VBox and added three labels to it. The vertical space between the labels is set with setSpacing() method. But it is a fixed value, say 20. if i change the value to 50, the space will be increased. But it is hard coding.
I want to…

PoornaChandra
- 341
- 2
- 9
9
votes
1 answer
Java FX Set Margin
This simple example creates an area with 2 rectangle areas marked in red.
I want to push the right area by n pixels towards the right using the VBox margin method but nothing happens. Why is margin not working in this example ? It works in scene…

Dezzo
- 170
- 1
- 2
- 9
8
votes
1 answer
Add border around VBox in javafx?
IS it possible to add a borderline around a whole content of a VBox in Javafx?
Meaning i have added a lot of components already in tis VBox but want to have a border around it?
So if i have the css file like this:
#vbox_style {
…

Mikael
- 633
- 2
- 8
- 15
8
votes
2 answers
JavaFX: setHgrow(...) doesn't work
I couldn't get the Elements in my HBox to grow, so I downloaded the following example code from java2s.com. It serves as a minimal not working example:
package fxtest;
import javafx.application.Application;
import javafx.scene.Group;
import…

Tonkel
- 155
- 1
- 1
- 6
6
votes
1 answer
Aligning Nodes to the right side of a Vbox in javafx
I'm trying to make a chatBox with javafx, and I want the messages from the client to be aligned to right and the rest to left.
I'm using a Vbox, wrapped in a Scrollpane and in that Vbox, each message is wrapped in another Vbox.
But aligning the…

yukashima huksay
- 5,834
- 7
- 45
- 78
5
votes
1 answer
ExtJS vbox layout autoheight
I have two extjs items which are of variable height to be layed out vertically.
I am using Ext.container.Container for the vertical layout, using the following code.
Ext.create('Ext.container.Container', {
//height:50,
renderTo:…

Chaitanya
- 2,396
- 4
- 29
- 45
4
votes
3 answers
autoscroll does not work with vbox layout
I need align the formpanels to the center, so I used the vbox layout, and after I used it the autoscroll did not work as before, the code is as below:
Usr.VWPanel = Ext.extend(Ext.Panel, {
id: null,
rid: null,
closable:…

mothee
- 141
- 2
- 4
- 12
4
votes
1 answer
JavaFX - How to make VBox children grow with VBox parent
VBox classBox = new VBox();
className = new Text("defaultClass");
classBox.setAlignment(Pos.CENTER);
classBox.getChildren().add(className);
classBox.getStyleClass().add(VM_BOXES);
variablesBox = new…

ricefieldboy
- 347
- 1
- 4
- 15
4
votes
3 answers
JavaFX ScrollPane not scrolling with VBox
I have a scrollpane on my screen and a vbox inside it. I add numerous checkboxes in this vbox (and I see it expanding) but the scrollpane doesn't seem to know that it should start showing a scrollbar when the content exceeds the height of that pane.…

Student2020
- 65
- 1
- 1
- 9
4
votes
2 answers
how to make child auto-resize (child is Pane, parent is VBox) in javafx
I have 2 questions
1.in a javafx application, I want to put the child(crosshairArea) at the left-top corner of its parent, with 1/2 width and height as well.
think I can do that via override the parent function "layoutChildren" (VBox),
is there…

Rui Zhou
- 209
- 1
- 3
- 9
4
votes
2 answers
difference between VBoxBuilder and VBox in javafx
Can anyone explain the difference between VBoxBuilder and VBox in JavaFX?
VBoxBuilder boxBuilder = VBoxBuilder.create();
VBox vBox1 = new VBox();

java baba
- 2,199
- 13
- 33
- 45
3
votes
1 answer
JavaFx - Text Wrapping not working on Checkbox inside VBox
I have a few UI elements that I want stacked vertically, in the center of the panel, all aligned on the left edge of the center. I've tried to do this with a VBox, and it was working until I added an item that had text that was too long; it always…

user1100069
- 53
- 5