...
 
Commits (2)
import java.awt.event.KeyListener;
import java.awt.event.KeyEvent;
import java.awt.*;
public class GestionClavier implements KeyListener {
MonDessin localdessin ;
public GestionClavier(MonDessin dessin) {
localdessin = dessin;
}
public void keyPressed(KeyEvent e){
}
public void keyReleased(KeyEvent e){
char pressedKey = e.getKeyChar();
if (pressedKey == 'r'){
localdessin.changeColor(Color.red);
}
else if (pressedKey == 'o'){
localdessin.changeColor(Color.orange);
}
else if (pressedKey == 'v'){
localdessin.changeColor(Color.green);
}
}
public void keyTyped(KeyEvent e){
}
}