package jiamian;
import java.awt.*;
import javax.swing.*;
import java.awt.event.*;
class jianpan extends JPanel implements KeyListener{
JPanel panel =new JPanel();
public void keyTyped(KeyEvent e) {
}
public void keyPressed(KeyEvent e) {
System.out.println("键盘输入");
}
public void keyReleased(KeyEvent e) {
}
public void paint(Graphics g){
super.paint(g);
}
jianpan(){
panel.addKeyListener(this);
}
}
public class heh {
public static void main(String[] args){
jianpan jian=new jianpan();
}
}
相关分类