I am trying to quickly and easily layout rows and columns of buttons and labels. Having buttons and labels be the same width looks ridiculous, so I have ruled out GridLayout
. I may slit my wrists if someone suggests GridBagLayout
. SO I was thinking SpringLayout
was my best option. But I am not a Groovy expert, and that is especially true of GUI stuff.
So I was hoping someone could provide or point to a simple example of using SpringLayout with SwingBuilder
. In particular, how to specify constraints, since in all of the SwingBuilder examples I see, each widget instance gets created on the fly without a named instance. So how would I reference another sibling or parent widget for relative constraints? I have not found anything on the internet that can explain this.
Working example code would with 2 rows/2 columns would get the win!
You can set
id
in a node and refer to theid
later as variable, for example:Perhaps you should try MigLayout for an easier solution.