Hi,
kann jemand mir bitte sagen, warum das hier nicht funktioniert?
Ich bekomme vom Programm keine Reaktion auf KeyEvents.
Danke im Voraus.
kann jemand mir bitte sagen, warum das hier nicht funktioniert?
Code:
import java.awt.*;
import java.applet.*;
import java.awt.event.*;
public class MyApplet extends Applet implements KeyListener {
public void init() {
addKeyListener(this);
}
public void paint(Graphics g) {
g.drawString("Welcome to Java!!", 50, 60 );
}
public void keyTyped(KeyEvent e) {
}
public void keyPressed(KeyEvent e) {
}
public void keyReleased(KeyEvent e) {
}
}
Ich bekomme vom Programm keine Reaktion auf KeyEvents.
Danke im Voraus.