You have a few problems.
1. GridLayout(0,2) specifies 0 rows and 2 columns (see its constructor). You have (I assume) 5 rows and 3 columns where each row is (label + input + x), spanning across 3 columns. Each component that you add is added horisontally, from left to right by default. See the docs:
https://docs.oracle.com/javase/7/docs/api/java/awt/GridLayout.html2. You're adding the same component lblX2 twice and you're missing some components.
3. The constructor to JTextField and JPasswordField is number of "columns". Set those to 1.
You should also refrain from using any unnecessary comments and keep blocks that are "the same" together. It's easier to spot mistakes in the beginning. You should also try to learn and use design pattern as soon possible, it helps. You might think it's too hard to get started with, but I ensure you, it's way harder to "just get it working" by putting everything in the same file. I recommend learning the pattern MVC (model/view/controller) to divide your user interface (view) and backend code (model) and use a controller to "mediate" the information between the view and model. It makes the application easier to debug as well
Working example (missing the listeners, you'll have to readd them plus you have to to delete duplicate declarations (declarations should always be kept at the top of every function/class))
Screenshot:
https://i.imgur.com/5MgdZ3T.pngCode
import javax.swing.*;
import java.awt.*;
public class Main {
public static void main(String[] args) {
JLabel lblUserName = new JLabel("Username:");
JLabel lblPassword = new JLabel("Password:");
JLabel lblRetype = new JLabel("Repeat Password:");
JLabel lblID = new JLabel("ID:");
JLabel lblPermission = new JLabel("Permission");
JTextField txtUserName = new JTextField(1);
JPasswordField txtPassword = new JPasswordField(1);
JPasswordField txtRetype = new JPasswordField(1);
JTextField txtID = new JTextField(1);
JTextField txtPermission = new JTextField(1);
JLabel lblX1 = new JLabel(" ");
JLabel lblX2 = new JLabel(" ");
JLabel lblX3 = new JLabel(" ");
JLabel lblX4 = new JLabel(" ");
JLabel lblX5 = new JLabel(" ");
// General Panel - adding top and bottom panels
JPanel pnlTop = new JPanel(new GridLayout(5, 3));
JPanel pnlGeneral = new JPanel(new BorderLayout());
pnlTop.add(lblUserName);
pnlTop.add(txtUserName);
pnlTop.add(lblX1);
pnlTop.add(lblPassword);
pnlTop.add(txtPassword);
pnlTop.add(lblX2);
pnlTop.add(lblRetype);
pnlTop.add(txtRetype);
pnlTop.add(lblX3);
pnlTop.add(lblID);
pnlTop.add(txtID);
pnlTop.add(lblX4);
pnlTop.add(lblPermission);
pnlTop.add(txtPermission);
pnlTop.add(lblX5);
// Bottom Panel -- Adding buttons
JPanel pnlBottom = new JPanel(new FlowLayout());
JButton btnCancel = new JButton("Cancel");
JButton btnSignUp = new JButton("Sign UP");
pnlBottom.add(btnCancel);
pnlBottom.add(btnSignUp);
pnlGeneral.add(pnlTop, BorderLayout.NORTH);
pnlGeneral.add(pnlBottom, BorderLayout.SOUTH);
// Setting size and location of screen
JFrame frame = new JFrame();
frame.setContentPane(pnlGeneral);
frame.setLocation(600, 400);
frame.setVisible(true);
frame.pack();
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
}
}