-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
For Compose for Desktop, allow to use Swing Components instead of rendering via skia (composable Swing) #1619
Comments
Compose supports a11y at the same level as Swing does. Pure Swing LaF is not that popular and customizing LF in Compose is easier than in Swing. As such I don't see much benefits in it, but the costs are huge. |
Swing LaFs are different, for example, I like native LaF and IntelliJ LaF. And would be cool to have an easy option to create Compose apps not bound to Material Design. Maybe it's a separate issue to support different LaFs. Regarding a11y, I'm actually not an expert, maybe Compose and Swing are already comparable and can work together at the same time: I haven't checked. What I mean is that using native Swing components has the benefit that many concepts will be inherited from Swing. Would be easier for those who already know Swing. And also to rewrite the app incrementally. Of course I agree that it can be low demand for this feature. |
This is one of our focuses now.
It is already here. There is two-way interop between Swing and Compose. You can easily rewrite only part of your app in Compose, keeping the rest in Swing. |
Cool!
I know that interop and partial rewriting are here but as I've said I just mean composable Swing could "be easier". Now, we need to rewrite a piece of UI from Swing to quite different Compose. But it would be easier to firstly rewrite from Swing to composable Swing, and only then, if needed, to native Compose components. |
Still, composable Swing doesn't look to me as a crazy idea: we already have composable DOM as the only available option in Compose for Web, and maybe a single canvas will come to Compose for Web later, but composable DOM will be still useful because it reuses already known concepts for plain Web. And the same for composable Swing. |
It is not crazy) Just efforts/value ratio is much less than many other features have. Also there is significant difference between DOM and Swing. Dom(HTML) is a declarative language, while Swing-java is definitely not. |
Swing is a dead end. It has been effectively abandoned in 2008 in favor of JavaFX, and there hasn't been any major development in that area since then. It has evolved a bit to support hi-dpi displays, and maybe Metal-based rendering pipeline on macOS, but there has been no real app-facing development in the last 13 years. Sure, Swing components come with built-in support for multiple look-and-feels, including the system ones. If you look close enough though, there are a lot of broken edges on Windows and macOS where the "native" look-and-feel is showing the signs of these 13 years of stagnation. And then, of course, you have a widget API surface that has not kept up with the times. Whatever the APIs are on The TL;DR version of it is simple. You don't really want to tie the future of Compose to the legacy shackles of Swing which has been frozen in time at what it was back in 2008. |
Surely it being a part of compose already should tell you otherwise. Swing is fantastic. It will live on for a long time. |
This discussion seem to be converting to flame. I close it. |
Please check the following ticket on YouTrack for follow-ups to this issue. GitHub issues will be closed in the coming weeks. |
I propose supporting a way that currently implemented in Compose for Web: it uses native DOM elements, not a single canvas. A similar feature would be handy for Compose for Desktop: creating Swing apps but in Kotlin and with the use of composable functions.
Other pros would be that it will support Swing LaFs as well as other standard Swing things like Accessibility.
The obvious con is that it can be not as performant as rendering to a single canvas. And also of course it will require some additional work in Compose for Desktop – it doesn't sound like an easy task.
Related to #1521?
The text was updated successfully, but these errors were encountered: