:wave: Hello everyone! Is there a way to make `Sw...
# compose-desktop
a
👋 Hello everyone! Is there a way to make
SwingPanel
rendered behind another composable? I've tried using the
Box
layout to wrap
SwingPanel
with the other composable but it seems like it always displays
SwingPanel
on top of the other.
Copy code
Box {
  SwingPanel { //logic here }
  Image { //logic here }
}
k
It's an interesting interoperability question. My understanding (and happy to hear from JB people otherwise) is that everything at Compose level is rendered as a single Skia-powered canvas. If this is correct, then a
Button
is not a traditional Swing component in a sense. And then, how can one interleave multiple `SwingPanel`s in that virtual hierarchy? Including translucency, event handling, etc.
e
You can use
z index
Modifier in Box to control "elevation"
o
@Roman Sedaikin [JB] wdyt?
r
The
SwingPanel
is the scope that will host the
java.awt.Component
. It's important to understand that the Compose layer is a
java.awt.Canvas
that renders all the composable components, so the AWT components are at the top. For now, I would recommend building a user interface based on this information.
a
@Erlan Amanatov oh ok, I'll look into it