title: Unable to type text in JTextfield
body: <p>So, I just wrote a very simple program that has 1 JLabel, 1 JTextField, and 2 JButtons. The problem is JTextField doesn't allow me to enter any texts. I've been thinking really hard about the problem, so any help would be appreciated!</p>
  
  <p><img src="https://i.stack.imgur.com/9qjtI.gif" alt="Animated picture"></p>
  
  <pre><code>/* Method: init() */
  /**
   * This method has the responsibility for reading in the data base
   * and initializing the interactors at the bottom of the window.
   */
  public void init() {
      setSize(APPLICATION_WIDTH, APPLICATION_HEIGHT);
      setFont("Courier-24");
  
      nameLabel = new JLabel("Name");
      add(nameLabel, SOUTH);
  
      nameField = new JTextField(10);
      add(nameField, SOUTH);
      nameField.addActionListener(this);
  
      graphButton = new JButton("Graph");
      add(graphButton, SOUTH);
  
      clearButton = new JButton("Clear");
      add(clearButton, SOUTH);
  
      addActionListeners();
  }
  
  /* Method: actionPerformed(e) */
  /**
   * This class is responsible for detecting when the buttons are
   * clicked, so you will have to define a method to respond to
   * button actions.
   */
  public void actionPerformed(ActionEvent e) {
      if (e.getSource() == nameField) 
          println("Graph: " + nameField.getText());
      if (e.getSource() == graphButton)
          println("Graph");
      if (e.getSource() == clearButton)
          println("Clear");
  }
  
  /* Private instance variables */
  private JLabel nameLabel;
  private JTextField nameField;
  private JButton graphButton;
  private JButton clearButton;
  </code></pre>