Ich möchte mittels KeyEvent herausfinden, ob die entsprechende Taste getippt wurde.
Das sieht dann bei mir so aus:
Code (Java):
public class Leinwand extends JPanel implements KeyListener,ActionListener{
private static final long serialVersionUID = 1L;
public Leinwand(){
timer = new Timer(fps60,this);
timer.start();
addKeyListener(this);
}
@Override
protected void paintComponent(Graphics g){
super.paintComponent(g);...
private static final long serialVersionUID = 1L;
public Leinwand(){
timer = new Timer(fps60,this);
timer.start();
addKeyListener(this);
}
@Override
protected void paintComponent(Graphics g){
super.paintComponent(g);...
Tastatureingabe gelingt mir nicht
0 commentaires:
Enregistrer un commentaire