When using appletviewer with the Linux JDK 1.1.[56] ports, the key event
functions are never called, (ie key{Up,Down} in Java 1.0.2 type programs
and KeyListener in Java 1.1 type programs.)

A simple Java 1.0.2 test program demonstrates this, it works (prints the
messages) when ran as a application, but as an applet the methods are
never called:

--
// <APPLET code=KeyTest102 width=100 height=100></APPLET>
import java.applet.*;
import java.awt.*;

public class KeyTest102 extends Applet {
        public void init() {
        }
        public void start() {
        }
        public boolean keyDown(Event evt, int key) {
                System.out.println("Key " + key + " pressed...");
                return true;
        }
        public boolean keyUp(Event evt, int key) {
                System.out.println("Key " + key + " released...");
                return true;
        }
        public static void main(String args[]) {
                KeyTest102 applet = new KeyTest102();
                Frame frame = new Frame("Key Test");
                frame.add(applet, "Center");
                frame.resize(100,100);
                applet.init();
                applet.start();
        }
}
--

Thanks



Reply via email to