Live data from Hacker News

Show HN: Sierra, a DSL for building Java Swing applications

github.com

1–10 of 34 posts

Re: Show HN: Sierra, a DSL for building Java Swing applications

#4
This looks really cool. Applying a thin layer over parts of the standard library is a very good idea IMO. Reduces the dependency tree but a lot.

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...

Re: Show HN: Sierra, a DSL for building Java Swing applications

#5

> Yes, I know hardly anyone uses Swing anymore. 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).

The only real problem with Swing is that there was never a version 2. If it had been separated from AWT, updated some of the APIs and given a modern look-and-feel, it would still be relevant today. JavaFX is nice, but it broke too many conventions.

And, of course, Oracle or OpenJDK (or someone) needed to invest in a browser port of the JVM, which is totally possible these days.

Re: Show HN: Sierra, a DSL for building Java Swing applications

#6
post #4

This looks really cool. Applying a thin layer over parts of the standard library is a very good idea IMO. Reduces the dependency tree but a lot. 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…

Great question. You can do this with a cell consumer (i.e. the with() method). See OrientationTest for an example (e.g. leftToRightButton, rightToLeftButton):

https://github.com/HTTP-RPC/Sierra/blob/master/sierra-test/s...

I should probably add a better example.

Re: Show HN: Sierra, a DSL for building Java Swing applications

#7

> Yes, I know hardly anyone uses Swing anymore. 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).

Agreed. I said as much in my response to this issue that was opened the other day:

https://github.com/HTTP-RPC/Sierra/issues/12

Re: Show HN: Sierra, a DSL for building Java Swing applications

#8

> Yes, I know hardly anyone uses Swing anymore. 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).

The only real problem with Swing is that there was never a version 2. If it had been separated from AWT, updated some of the APIs and given a modern look-and-feel, it would still be relevant today. JavaFX is nice, but it broke too many conventions. And, of course, Oracle or OpenJDK (or someone) needed to invest in a browser port of the JVM, which is totally possible these days.

Take a look at FlatLAF:

https://github.com/JFormDesigner/FlatLaf

They have done a great job bringing a modern appearance to the Swing components.

Post reply on HN