I wonder if there are any suggestions for declarative GUI programming in Java. (I abhor visual-based GUI creator/editor software, but am getting a little tired of manually i
If conciseness is important you might want to consider the double brace idiom:
new JFrame("My Frame") {{
setName("myFrame");
add(new JLabel("My First Label") {{
setName("myLabel2");
}};
add(new JLabel("My Second Label") {{
setName("myLabel2");
}};
}}
You then don't lose any of the power of a well known general purpose programming language (you know you are going to need it, and JellyTags suck). All you need is the one little extra idiom.
It's not used very much, because actually people pissing around with XML weren't solving real pain points.
In general you can use builder layers to abstract repeated code. GUI code doesn't have to be badly written, it's just that almost all of it is (including in text books).