views:

21

answers:

0

Is there an easy way to get all (or most) of the components in a GroupLayout application NOT stretch vertically? I know I can do it by forcing each component to it's preferred size when I add it, but that makes the code so much more verbose:

       .addGroup(layout.createSequentialGroup()
          .addComponent(oDevRadio)
          .addComponent(oInstRadio)
       )

Becomes

       .addGroup(layout.createSequentialGroup()
          .addComponent(oDevRadio,
                        GroupLayout.PREFERRED_SIZE,
                        GroupLayout.PREFERRED_SIZE,
                        GroupLayout.PREFERRED_SIZE)
          .addComponent(oInstRadio,
                        GroupLayout.PREFERRED_SIZE,
                        GroupLayout.PREFERRED_SIZE,
                        GroupLayout.PREFERRED_SIZE)
       )

Is there a way to set it as a default, and just specify the elements I want to be stretchable?

References - addComponent's spec