posted 22 years ago
I am working on a GUI that uses GridBagLayout, and I am having some difficulties getting things laid out the way I want them. The GUI consists of six JTextFields, six JLabels, and two JButtons
I want the two buttons to be half the width of the GUI, and the rest of the GUI laid out as appropriate for the widths of the fields and labels. Unfortunately, one of the JLabels is wider than half the area, and it seems to be defining the grid cell width (the edge of the buttons line up with the edge of the is label). I've tried adding extra cells in the grid, but that doesn't solve the problem.
Attached is a copy of the code that does my GUI layout. The GUI has a few other problems, but they are along the same lines. If anyone can give me a suggestion as to how to fix this problem, I should be able to get the rest of it to work.
Thanks for the help,
Don