I know a little bit about Groovy:
- Some of the ways syntax is more concise
- How closures can be useful in replacing Java anonymous inner classes.
- How builders can make tree construction easier
With all of this, I expected it to be apparent how Groovy SwingBuilder was miles above setting things up in Java. But the examples I've seen in book and web just don't look any more concise or readable than the Java version I would expect.
Could someone give a good example of Java vs. Groovy, real or contrived, where Groovy Swing shines?
It didn't shine. It simply saves you a lot of code. You can complain, but as I see, such table creation is better, than have a distinct model class, a lot of unnecessary lines, such as method declarations and annotations, and so on.
Besides simple table creation, and very powerful closureColumn, there is an easy readable simple example:
And now, please answer, how many lines of code will you write, to achieve such result?
EDIT: Added second example Groovy non-SwingBuilder code.