package www.huarongdao.game;
import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
public class Person extends JButton implements FocusListener {
int number;
Person(int number,String s){
this.number=number;
System.out.println("打印名字:"+s);
addFocusListener(this);
}
public void focusGained(FocusEvent e){
//setBackground(Color.GREEN);
}
public void focusLost(FocusEvent e){
//setBackground(Color.RED);
}
}

最近下载
最近浏览
