Trying to put a "browser"/webview in my compose de...
# compose-desktop
c
Trying to put a "browser"/webview in my compose desktop app, but this doesn't seem to exist? I was looking and found that you can put a Swing component into your compose app and so I looked up and saw that you can build a webview with swing... and so now I'm using this tutorial but it doesn't compile https://github.com/JetBrains/compose-jb/tree/master/tutorials/Swing_Integration#adding-a-swing-component-to-cfd-composition-using-swingpanel It doesn't compile because it can't resolve
import androidx.compose.desktop.SwingPanel
I don't want this to be an x/y problem here. Can anyone point me in the right direction? 1. Does compose desktop actually support a webview? If so, maybe I missed that api completely? 2. If going the embeded swing route with a WebView is actually the best path forward, how do I get the import statement to resolve? I looked up if there is a maven artifact for swing in the same namespace as compose but came up empty handed.
j
There has been some work put into "chromium embedded framework" (https://github.com/JetBrains/compose-jb/tree/master/cef) which honestly is probably your best bet, but it's a bit experimental at the moment and only supports Windows+Linux, but things move fast in the Compose Desktop world and it will probably be updated to support Mac OSX at some point if you're willing to wait or contribute. It doesn't yet come as a pre-packaged widget, so you will need to copy-paste from github.
👍 2
i
Use the latest version of Compose (
0.3.0-build152
) to be able to use
SwingPanel
👍 1
119 Views