onWindow
Finds the single realized window (see ComposeSwingTest.onWindow). Convenience for the common one-window composition. SwingWindowInteraction.fetch is the last resort: to read a value, use org.jetbrains.compose.swing.test.interaction.assertProperty or an assertion.
Name a narrower window type at SwingWindowInteraction.fetch:
setContent { Window(onCloseRequest = {}, title = "Main") { ... } }
val frame = onWindow().fetch<JFrame>()Content copied to clipboard