Farouk Alhassan Farouk Alhassan - 2 months ago 9
Java Question

javaFX 2.0 set component to full with and height of immediate parent

How can I make a

TextArea
take the full width and height of the parent pane.

I tried this:

TextArea textArea = new TextArea();
textArea.setScaleX( 100 );
textArea.setScaleY( 100 );


but the element defined in the top via
parent.setTop(...)
was covered.

Reducing the
scaleY
had no effect.

What else do I have to do to achieve this?

Thanks

Answer

solved with this

textArea.setPrefSize( Double.MAX_VALUE, Double.MAX_VALUE );
Comments