Farouk Alhassan Farouk Alhassan - 1 year ago 132
Java Question

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

How can I make a

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
was covered.

Reducing the
had no effect.

What else do I have to do to achieve this?


Answer Source

solved with this

textArea.setPrefSize( Double.MAX_VALUE, Double.MAX_VALUE );
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download