androidx.compose.ui.awt


Classes

ComposeDialog

ComposeDialog is a dialog for building UI using Compose for Desktop.

ComposePanel

ComposePanel is a panel for building UI using Compose for Desktop.

ComposeWindow

ComposeWindow is a window for building UI using Compose for Desktop.

Top-level functions summary

Unit
@Composable
<T : Component> SwingPanel(
    background: Color,
    factory: () -> T,
    modifier: Modifier,
    update: (T) -> Unit
)

Composes an AWT/Swing component obtained from factory.

Top-level properties summary

Top-level functions

SwingPanel

@Composable
fun <T : Component> SwingPanel(
    background: Color = Color.White,
    factory: () -> T,
    modifier: Modifier = Modifier,
    update: (T) -> Unit = NoOpUpdate
): Unit

Composes an AWT/Swing component obtained from factory. The factory block will be called to obtain the Component to be composed.

The Swing component is placed on top of the Compose layer (that means that Compose content can't overlap or clip it). This can be changed in the future, when the better interop with Swing will be implemented. See related issues: https://github.com/JetBrains/compose-jb/issues/1521 https://github.com/JetBrains/compose-jb/issues/1202 https://github.com/JetBrains/compose-jb/issues/1449

The update block runs due to recomposition, this is the place to set Component properties depending on state. When state changes, the block will be reexecuted to set the new properties.

Parameters
background: Color = Color.White

Background color of SwingPanel

factory: () -> T

The block creating the Component to be composed.

modifier: Modifier = Modifier

The modifier to be applied to the layout.

update: (T) -> Unit = NoOpUpdate

The callback to be invoked after the layout is inflated.

Top-level properties

NoOpUpdate

val NoOpUpdateComponent.() -> Unit