Using the `SwingPanel` I notice a white flickering...
# compose-desktop
r
Using the
SwingPanel
I notice a white flickering on appearing and disappearing. Can we avoid this or at least specify a different color? I would avoid using a
SwingPanel
, but I need to display html content, therefore I need to use
Kcef/Jcef
browser.
Tested with CMP 1.6.11 and 1.7.0-alpha01
Copy code
Box(
contentAlignment = Alignment.Center, modifier = Modifier
       .fillMaxSize()
) {
 var isSwingPanelOpen by remember {
mutableStateOf(false)
 }

 Button(
   onClick = { 
isSwingPanelOpen = !isSwingPanelOpen 
},
  modifier = Modifier.align(Alignment.TopCenter)
 ) {
    Text("Toggle Swing Panel")
  }

if (isSwingPanelOpen) {
  SwingPanel(
    factory = {
   JPanel().apply {
    background = java.awt.Color.RED
    }
   },
   background = Color.Green,
   modifier = Modifier
            .size(300.dp)
            .align(Alignment.Center)
            .background(Color.Green)
            )
        }
    }
a
r
Issue created: CMP-578
a
Thanks