下面是利用java窗体实现动物发声模拟器,点击按钮就可以显示动物们的信息,遇到了以下问题

问题遇到的现象和发生背景

在设计JButton时不知道怎么应用动作监听器

具体的JFrame代码如下, 监听器未补充完整。
//代码正文
package nuc.sw.animal;
import javax.swing.*;
import nuc.sw.animal2.Pet;
import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;



public class PetJFrame extends JFrame{
    private JButton b_cat, b_dog, b_parrot;
    private JTextField t_cat, t_dog, t_parrot;





    //窗体初始化

    public  PetJFrame() {
        this.setTitle("动物模拟发声器一代");
        this.setSize(400, 450);
        this.setLocation(200, 300);
        init();
        this.setVisible(true);
    }
    

    public void init() {
        this.setLayout(new GridLayout(3, 2, 5, 5));
        b_dog = new JButton("修勾");
        b_dog.addActionListener(new ActionListener() {

            @Override
            public void actionPerformed(ActionEvent e) {
                // TODO Auto-generated method stub
                
                
            }
            
            
        });
        
        
        
        
        b_cat = new JButton("修猫");
        b_cat.addActionListener(new ActionListener() {

            @Override
            public void actionPerformed(ActionEvent e) {
                // TODO Auto-generated method stub
                
            }
            
            
        });
        
        
        
        
        
        b_parrot = new JButton("鹦鹉");
        b_parrot.addActionListener(new ActionListener() {

            @Override
            public void actionPerformed(ActionEvent e) {
                // TODO Auto-generated method stub
                
            }
            
            
        });
        
        
        
        
        
        t_cat = new JTextField();
        t_dog = new JTextField();
        t_parrot = new JTextField();
        
        
        this.add(b_cat);
        this.add(t_cat);
        
        this.add(b_dog);
        this.add(t_dog);
        
        this.add(b_parrot);
        this.add(t_parrot);
    }
    
    
    
}
效果如图

img

期望效果

img

目前只实现了在控制台输出,求解如何在点击按钮时输出

img

监听按钮点击事件,然后set到textField就好