title: Why wont this program display the text?
body: <p>There are some other problems that have arisen but the program when it ran had a lot of errors and no outputs. one was a null pointer. now it also says "The type Talk must implement the inherited abstract method ActionListener.actionPerformed(ActionEvent)". and it says also "void is an invalid type for the variable actionPerformed".</p>
  
  <pre><code>import javax.swing.*;
  
  import java.awt.*;
  import java.awt.event.*;
  
  public class Talk extends JFrame implements ActionListener{
      JTextField first;
      JTextField second;
      JButton b = new JButton("ok");
      public Talk(){
          JPanel panel = new JPanel();
          add(panel);
          panel.setLayout(new FlowLayout(FlowLayout.LEFT,10,20));
          panel.add(new JLabel("First Name"));
          JTextField first = new JTextField(8);
          panel.add(first);
          panel.add(new JLabel("Last Name"));
          JTextField last = new JTextField(8);
          panel.add(last);
          panel.add(b);
          b.addActionListener(this);
  
  
  
  
  
  public void actionPerformed(ActionEvent e) {
      if (e.getSource()==b){
          String data = first.getText();
          String data2 = second.getText();
          System.out.println("Welcome " + data + data2);
      }
  
  }}
  
  public static void main(String[] args){
      Talk frame = new Talk();
      frame.setTitle("Your Name");
      frame.setSize(500,500);
      frame.setLocationRelativeTo(null);
      frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
      frame.setVisible(true);
  }}
  </code></pre>