recompose

fun recompose(update: () -> Unit): Component?

Runs update, then recomposes and applies this composition synchronously, so its Swing subtree is fully materialized before this returns. The write is recorded against this composition so the synchronous recompose sees the change; this takes no frame from a window recomposer.

A call from inside another recompose runs neither update nor a recompose, and answers the component the outer call is already in the middle of producing - the same component this call would otherwise materialize again. Once this composition is disposed, update does not run and this answers null, the way an already-disposed DisposableHandle does nothing rather than failing: a Swing widget keeps invoking a renderer it captured even while its window is torn down.

A pass that composes more than one top-level component disposes this composition before throwing IllegalStateException, so later calls follow the disposed-composition behavior.

Must be called on the Event Dispatch Thread.

Return

the one top-level component content composes, or null where it composes none.

Parameters

update

writes whatever state content reads before this recomposes.