GridPane prevents layouting

Mario Ivankovits mario at
Thu Nov 7 02:48:12 PST 2013

Hi JavaFX-Devs!

I do have a situation where the GridPane prevents the refreshing of parts of a scene.
Unhappily I am not yet able to reconstruct this case in an simple test, but what I have found ist hat GridPane.requestLayout sometimes prevents bubbling up the request and thus never reaches the point where the Toolkit.requestNextPulse() will be called.

The problematic frame in GridPane:

    @Override public void requestLayout() {
        // RT-18878: Do not update metrics dirty if we are performing layout.
        // If metricsDirty is set true during a layout pass the next call to computeGridMetrics()
        // will clear all the cell bounds resulting in out of date info until the
        // next layout pass.
        if (performingLayout || metricsDirty) {

As far as I can see, at least super.requestLayout() should be called in the "if" case so the request can bubble further up.
Otherwise, the components within the GridPane "cell" are marked with "needsLayout", but they never get layouted until you e.g. resize the window.

Best regards,

More information about the openjfx-dev mailing list