I'm confused how GridBagLayout can be used as if it was GridLayout(0,2).
For example, I would like to lay out components like this:
Label TextFieldForLabel
Label TextFieldForLabel
Label TextFieldForLabel
Label TextFieldForLabel
I thought by making a GridBagConstraints() Object, then setting the gridx and gridy variables, this could be accomplished (Java Sun tutorials). However, I have tried numerous ways of doing this, and I can't get anything laid out correctly. In my code, I tried the following:
-using a pattern of setting gridx to "RELATIVE" and setting gridy to 0, then I'd set gridy to RELATIVE and gridx to 0 for the next component I added.
I also tried a few other ways that didn't work.