Prevent child controls from being drawn outside of the parent control
ytwApr 9 2012 — edited Apr 9 2012Hello,
I have some code like below to create a rounded box.
VBox box = new VBox();
box.setStyle("-fx-border-width: 5; -fx-border-color: red; -fx-border-radius: 33; -fx-background-color: green; -fx-background-radius: 33;");
That worked, but the problem now is that parts of the child controls that are placed near the corners are drawn outside of the parent box. Is there a way to 'clip' the child controls against the rounded corners of the parent control so the child controls aren't drawn outside of the parent? I guess I need the equivalent of "overflow: hidden;" in css.
Thanks.