HO UN FRAME
vorrei intercettare la pressione di un tasto dalla tastiera :
ho provato cosi:
private void initialize() {
frame_AggiungiSezione = new JFrame();
frame_AggiungiSezione.addKeyListener(new KeyAdapter() {
public void keyPressed(KeyEvent e) {
System.out.println("Tasto cliccato");
}
});
frame_AggiungiSezione.setBounds(100, 100, 550, 452);
ma non succede niente, dive sbaglio ?