title: Java: The TextField Listener won't work
body: <p>My code is the following:</p>
  
  <pre><code>package playingwithjava;
  
  import java.awt.*;
  import java.awt.event.*;
  import javax.swing.*;
  /**
   *
   * @author user
   */
  public class Window extends JFrame implements ActionListener{
      //init stuff
      Container ca=getContentPane();
      GridBagLayout gridLayout= new GridBagLayout();
      GridBagConstraints lol=new GridBagConstraints();
  
      //actual important stuff
  
      JButton done=new JButton("Done!");
      JTextField text=new JTextField("",25);
      JLabel label=new JLabel("Your name is:");
  
      public Window(int x,int y)
      {
          super("Playing With Java");
          setSize(x,y);
          setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
          ca.setLayout(gridLayout);
          //start of the code
          lol.gridx=0;lol.gridy=0;
          ca.add(label,lol);
  
          lol.gridx=0;lol.gridy=1;
          text.addActionListener(this);
          ca.add(text,lol);
  
          lol.gridx=1;lol.gridy=1;
          //done.setEnabled(false);
          done.addActionListener(this);
          ca.add(done,lol);
  
          //ending
          setContentPane(ca);
          setVisible(true);
      }
      @Override
      public void actionPerformed(ActionEvent event)
      {
          if(event.getSource()==done)
          {
              JOptionPane.showMessageDialog(null,"Hello, "+text.getText()+"!","Hi!",JOptionPane.NO_OPTION);
          }
          if(event.getSource()==text)
          {
              JOptionPane.showMessageDialog(null,"a","Hi!",JOptionPane.NO_OPTION);
  
          }
      }
  }
  </code></pre>
  
  <p>I don't get why nothing happens when i change the text in the TextField. </p>