Detecting that the mouse enters my JTextField component

Implement a mouseListener and override the methods mouseEntered and mouseExited.
Main.java:

import java.awt.event.*;
import javax.swing.*;
import java.awt.*;
 
public class Main extends JFrame
{
   public Main() {
      getContentPane().setLayout(new FlowLayout());
      JTextField textfield = new JTextField(20);
      getContentPane().add(textfield);
      final JLabel label = new JLabel();
      getContentPane().add(label);
 
      textfield.addMouseListener(new MouseAdapter() {
         public void mouseEntered(MouseEvent me) {
            label.setText("Mouse is inside JTextField!");
         }
         public void mouseExited(MouseEvent me) {
            label.setText("");
         }
      });
 
      addWindowListener(new WindowAdapter() {
         public void windowClosing(WindowEvent we) {
            System.exit(0);
         }
      });
   }
 
   public static void main(String [] args) {
      Main main = new Main();
      main.setSize(300, 300);
      main.setVisible(true);
   } 
}