Re:Show HN: Sierra, a DSL for building Java Swing applications
by gk_brown on Tuesday January 03, 2023 @10:51AM
(#34232987)
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
by gk_brown on Tuesday January 03, 2023 @12:37PM
(#34234764)
Added an example demonstrating how to add an action listener to a button:
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.
Re:Show HN: Sierra, a DSL for building Java Swing applications
by kitd on Tuesday January 03, 2023 @01:09PM
(#34235248)
That's great! As I say, my swing experience is very old and it's probably just a case of remembering the basic action framework more than anything else.
But that fits in very nicely with how your library works using with().
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...