Tu dois pas avoir de chance,
chez moi ca marche
j'ai juste un peu retoucher ton code :
import javax.swing.*;
import java.awt.event.*;
public class APIKey extends JFrame implements KeyListener{
public static void main(String[] args){
APIKey pouet = new APIKey() ;
}
public APIKey() {
this.setSize(400 , 300);
this.setDefaultCloseOperation(EXIT_ON_CLOSE);
this.addKeyListener(this);
this.setVisible(true);
}
public void keyPressed(KeyEvent e){
System.out.println(e);
}
public void keyReleased(KeyEvent e){
System.out.println(e);
}
public void keyTyped(KeyEvent e){
System.out.println(e);
}
}