1

I've designed a Swing GUI using the NetBeans designer, meaning that it's a GroupLayout. I would like to go in and manually change the elements in one of the vertical groups it created, however that code is uneditable and I don't see anything in the properties dialog that would allow me to do this. Any suggestions?

drew moore
  • 31,565
  • 17
  • 75
  • 112
  • 1
    Hand-code your layout ? Adjust it in the Netbeans UI iso trying to mess with the generated code – Robin Mar 18 '13 at 10:27
  • @Robin - Feel free to disagree, but I think it can be useful to utilize graphical design tools in conjunction with hand-coding parts of layouts. I used to hand-code everything on principal, as it seems you do, but have recently found that a hybrid approach can be helpful (in that it capacitates more versatility) in certain situations. And in those situations, it would be helpful to be able to modify the generated code when needed - which is essentially the subject of this question. – drew moore Mar 18 '13 at 10:45

1 Answers1

1

GroupLayout has very limited code-generation property support in the GUI designer; the generated code depends almost entirely on designer positioning. You may want to examine the properties available to other layouts for comparison, e.g. GridBagLayout.

While it's tempting to use the designer for the entire GUI, you may want to consider the approach shown here, in which use of the designer is limited to one (or a few) panels in a single top-level container.

Community
  • 1
  • 1
trashgod
  • 203,806
  • 29
  • 246
  • 1,045