I was watching java tutorial 54 and I copied the code exactly but I get these errors

import java.awt.FlowLayout;
import java.awt.event.ActionListener;
import java.awt.event.ActionEvent;
import javax.swing.JFrame;
import javax.swing.JTextField;
import javax.swing.JPasswordField;
import javax.swing.JOptionPane;

public class pumpkin extends JFrame {
private JTextField item1;
private JTextField item2;
private JTextField item3;
private JPasswordField PasswordField;
public pumpkin(){
super("The Pumpkin");
setLayout(new FlowLayout());
item1 = new JTextField(10);
add(item1);
item2 = new JTextField("Enter Text Here");
add(item2);
item3 = new JTextField("Uneditable", 20);
item3.setEditable(false);
add(item3);
PasswordField = new JPasswordField("mypass");
add(PasswordField);

thehandler handler = new thehandler();
item1.addActionListener(handler);
item2.addActionListener(handler);
item3.addActionListener(handler);
PasswordField.addActionListener(handler);

class handler implements ActionListener{
public void actionPerformed(ActionEvent event){
String string = "";

if(event.getSource()==item1)
string = String.format("Field 1: %s", event.getActionCommand());
else if(event.getSource()==item2)
string = String.format("Field 2: %s", event.getActionCommand());
else if(event.getSource()==item3)
string = String.format("Field 3: %s", event.getActionCommand());
else if(event.getSource()==PasswordField)
string = String.format("Passeord field is %s", event.getActionCommand());
JOptionPane.showMessageDialog(null, string);
}

}
}



}

I get errors on lines 28-31, and item 1-4 cannot be resolved to a variable for some reason.
Can you help me to fix this?