ExistingSwingNode
Configures a component its parent already built and keeps, such as a JScrollPane's scroll bars or a JLayer's glass pane, the way SwingNode configures a component its own factory builds.
The parent is the component of the node this one is composed directly under. claim runs on the parent when the node is created, and returns the component this node configures; it need not be a direct Swing child of the parent. A function reference infers both type parameters - ExistingSwingNode(claim = JScrollPane::getVerticalScrollBar) - and a lambda needs them written: ExistingSwingNode<JScrollPane, JScrollBar>(claim = { verticalScrollBar }).
claim is read once, when the node is created, as SwingNode reads its factory: a later claim is not called and changes nothing. The claim holds for the node's life. Relocated under another parent, such as by movableContentOf, the node is refused. A part the parent replaces afterwards keeps nothing of this node's declarations, so the code that replaces a part keys the node claiming it on that part - key(part) { ExistingSwingNode(...) } - and a new node claims the new part. Replacing a claimed part from outside that code is undefined behavior.
The node never adds, removes or moves the claimed component. When the node leaves the composition, every property modifier declared is given back and every listener it installed is removed; the component stays where its parent holds it. What update wrote stays on the component.
Within one composition, a component is claimed by at most one node at a time. A second node claiming it is refused, including a node that replaces the first one under a changed key.
Under a host that holds its children in regions, the node names the region its component stands in with org.jetbrains.compose.swing.modifier.layout.slot without an attachment. Under an indexed host it names nothing. That is the one placement the node declares: the parent placed the component, so parent data such as layoutConstraint or a row's weight is refused.
Parameters
the SwingModifier applied to the claimed component, after update has run.
typed update block; see SwingNodeUpdater.
Container variant of ExistingSwingNode that composes content into the claimed container.
The claimed container keeps its own layout manager.
When the node leaves the composition, the children content composed are removed from the container, and what update wrote - the layout included - stays on it.
Parameters
finds the container this node configures on its parent; see the leaf overload.
the SwingModifier applied to the claimed container, after update has run.
typed update block; see SwingNodeUpdater.
how children composed under this node are held; see ChildPlacement. Defaults to ChildPlacement.Indexed.
the composables the claimed container holds as its children.