title: I'm trying to set JTextField under JLabel
body: <p>I'm trying to put the text field under the <code>JLabel</code>. Currently, the text field is displayed on the same line. It should be below and centered. I need assistance.</p>
  
  <pre><code>package Gui;
  
  import javax.swing.*;
  import java.awt.*;
  import java.awt.GridLayout;
  
  public class ShowGridLayout extends JFrame {
  
      public ShowGridLayout() {
          // Set GridLayout, 3 rows, 2 columns, and gaps 5 between
          // components horizontally and vertically
          setLayout(new GridLayout(3, 2, 5, 5));
  
          // Add labels and text fields to the frame
  
          JLabel firstname = new JLabel("First Name");
          add(firstname);
  
          JTextField fistnametextField = new JTextField(8);
          add(fistnametextField);
  
          JLabel mi = new JLabel("Mi");
          add(mi);
  
          JTextField miTextField = new JTextField(1);
          add(miTextField);
  
          JLabel lastname = new JLabel("Last Name");
          add(lastname);
  
          JTextField lastnameTextField = new JTextField(8);
          add(lastnameTextField);
      }
  
      /**
      * Main method
      */
      public static void main(String[] args) {
          ShowGridLayout frame = new ShowGridLayout();
          frame.setTitle("ShowGridLayout");
          frame.setSize(200, 125);
          frame.setLocationRelativeTo(null); // Center the frame
          frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
          frame.setVisible(true);
      }
  }
  </code></pre>