`VBox` doesn't put Node under `FlowPane`
Hello, my problem is than my VBox doesn't put next Node under my
FlowPane
. I'm adding nodes dynamicly to it and VBox put's next Node below FIRST line in FlowPane.
Do you know what may cause that?👀25 Replies
Hey, @fertiz!
Please remember to
/close
this post once your question has been answered!Hello, can you show some code?
sure
(^ This is what I add to FlowPane)
(^ this is FlowPane)
(^ this is how I use Flowpane)
![No description](https://cdn.answeroverflow.com/1051179311245316187/image.png)
the parent is
VBox
with 50 spacing
so I think somehow FlowPane height is just for 1 row.
any clue?So issue is that red and yellow box overlaps?
yes
that yellow box overlaps red one (red = FlowPane)
but when I have just 1 row of FlowPane, everything is good
it's like it doesnt count the second row
huh, that seems like a bug in calculation of a height.
What if you remove the priority for Vgrow?
or isn't the issue that it does not fit into the total height?
I mean whenever I tried
HBox#getWidth
(from CustomStat) it returns 0, same goes for height and FlowPanegetWidth is tricky. Try to use getPrefWidth/getPrefHeight
from what I remember, the pref properties are properly updated
yes but
VBox
doesn't use getPrefWidth
but getWidth
same goes for height
I see... 🤔
idk why it calculates only first row
Unfortunately I'm not close to my computer so I can not try it... :/
my FlowPane is actually good, I rendered the border
but idk why other pane overlaps it
you can maybe try to call "requestLayout" on VBox manually...
still nothing
drawn borders
![No description](https://cdn.answeroverflow.com/1051203080546431016/image.png)
What version of JavaFX do you use? Have you tried latest version? Maybe it is fixed in some newer versions...
it is latest
is there any other alternative for FlowPane :??
Just to be sure... Well, I can not help now, but I will check it tomorrow when I will be on computer...
alright
Nothing of what I know... Maybe some 3rd party lib
I think I got it working, all I had to do was
flowPane.setMinHeight(flowPane.prefHeight(-1));
crazyPost Closed
This post has been closed by <@723844486974668810>.