Preview fails to render when there's a SwingPanel
The preview pane is stuck on "Rendering preview" when trying to preview this
@Preview
@Composable
private fun TestPreview() {
SwingPanel(
factory = { JTextArea("Hello world") }
)
}
Gradle dependency: 1.0.0-alpha3 Plugin: org.jetbrains.compose.desktop.ide (1.0.0-alpha4-build315)
From Intellij:
IntelliJ IDEA 2021.2 (Ultimate Edition) Build #IU-212.4746.92, built on July 27, 2021 Runtime version: 11.0.11+9-b1504.13 x86_64 VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o. macOS 11.5.1 Kotlin: 212-1.5.10-release-IJ4746.92
@asapha and with plain Compose it works fine on your system?
Yes it works, although I needed to add a size (modifier = Modifier.size(80.dp)) to the call for anything to appear.
Further info: I need to restart the IDE in order to make any other preview work after trying the above.
Reproduced with the same idea, plugin build 310.
Please check the following ticket on YouTrack for follow-ups to this issue. GitHub issues will be closed in the coming weeks.