Problem arranging components in GridBagLayout

The frame is 600x600. Inside it, there are two pairs of (Label,TextField). They are not where I want them to be. What I would like is to have them all at the top of the frame, one after each other. Moreover, I would like all the labels aligned together (easy) but also all the textField aligned together...

Now, my pairs of (Label,TextField) are spread all over the panel, they aren't all at the top. The second pair is at the middle of the frame, and I would like it to be right after the first pair, just following it. And of course, the frame have to stay 600x600. I would like to be able to do that using the GridBagLayout because it will be useful later if I need to do any modification.

hi friend,
i think you are fighting to arrange the component as per your wish
but they runing here and there :icon_cheesygrin:
Here i will give you the solution not exactly to your questions answer but an alternative to you.
you can use use the null layout for design your frame as per your wish you can control each and every part of your frame
here is the modified code for your above code.

hi friend,
i think you are fighting to arrange the component as per your wish
but they runing here and there :icon_cheesygrin:
Here i will give you the solution not exactly to your questions answer but an alternative to you.
you can use use the null layout for design your frame as per your wish you can control each and every part of your frame
here is the modified code for your above code.

I have a 2d matrix with dimension (3, n) called A, I want to calculate the normalization and cross product of two arrays (b,z) (see the code please) for each column (for the first column, then the second one and so on).
the function that I created to find the ...

Write a C program that should create a 10 element array of random integers (0 to 9). The program should total all of the numbers in the odd positions of the array and compare them with the total of the numbers in the even positions of the array and indicate ...