Yes, I know hardly anyone uses Swing anymore. :-) I basically just did it for fun and thought I would share. |
Yes, I know hardly anyone uses Swing anymore. :-) I basically just did it for fun and thought I would share. |
One question (my Swing knowledge is at least 15 years old!): what's the simplest way to handle events using this? Eg taking the FormTest [1] example, how might one simply bind a model object to the UI elements?
[1] https://github.com/HTTP-RPC/Sierra/blob/master/sierra-test/s...
https://github.com/HTTP-RPC/Sierra/blob/master/sierra-test/s...
I'm not sure it's exactly what you were looking for, but hopefully it is similar enough.
But that fits in very nicely with how your library works using with().
https://github.com/HTTP-RPC/Sierra/blob/master/sierra-test/s...
I should probably add a better example.
Actually, Swing is the GUI toolkit used by IntelliJ IDEA, one of the few if not the only commercially successful and kick-ass Java desktop app(s).
And, of course, Oracle or OpenJDK (or someone) needed to invest in a browser port of the JVM, which is totally possible these days.
https://github.com/JFormDesigner/FlatLaf
They have done a great job bringing a modern appearance to the Swing components.
* https://blog.jetbrains.com/fleet/2022/01/fleet-below-deck-pa...
* https://twitter.com/jetbrains_fleet/status/14653112312717393...
JavaFX is sorta the spiritual successor to swing. On linux, you can actually run it straight from the framebuffer! (No 'desktop' needed!)
There was also this discussion a long while back: https://news.ycombinator.com/item?id=25121705 The project is actively maintained and sees commits quite a bit! Might be what you're looking for.
JavaFX started out as a Java library on top of Swing but the lack of object literals and lambdas led to the creation of the F3 language (code-named foo for "funcional object-oriented").
Despite Java's progress since then its syntax still feels somewhat rigid. Sierra looks very nice indeed. It could benefit from a more fluid, less syntax-encumbered DSL laid on top of it in Kotlin or Scala.
Laying out a Kotlin DSL on top of it could be an excellent opt-in feature to leverage the core in a more declarative way
Some webdev libraries/frameworks have gone a step further and include code in the same page (though maybe it could/should be collapsed by default sometimes).
This might be useful as an overview of what it is more then live examples
I've maintained or built Swing applications for work and at university. One was a game.
I hope I'm not the only one who feels frontend programming is difficult to get right and to get maintainable software.
I would like to learn Qt but the C++ is a barrier to learning it.
However, I ultimately found that approach too limiting and went with custom layout managers for version 1.2.
As I understand it, IDEA has done a lot of "Swing Work". I don't know if it's just augmenting existing or creating a bunch of new controls or if they delved deeper. It's just my understanding that IDEA is Swing, but not as we know it. I could be wrong.
NetBeans is pretty much pure Swing.