Why doesn't my applet work - Programmers Heaven

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.

Why doesn't my applet work

RED4RUMRED4RUM Posts: 2Member
Below is the code for a simple applet which should generate messages when I move the cursor around. I've written a simple applet tag to run it but nothing happens. If someone would point out why this code doesn't work I would be much obliged.


import java.applet.Applet;
import java.awt.*;

public class EventTutor extends Applet {

public void init() {
System.out.println("init event");
}

public void paint(Graphics g) {
System.out.println("paint event");
}

public void start() {
System.out.println("start event");
}

public void destroy() {
System.out.println("destroy event");
}

public void update(Graphics g) {
System.out.println("update event");
}

public boolean processMouseEvent(Event e, int x, int y) {
System.out.println("event");
return false;
}

public boolean processMouseMotionEvent(Event e, int x, int y) {
System.out.println("motion event");
return false;
}

public void getFocus() {
System.out.println("getFocus event");
}

public void gotFocus() {
System.out.println("gotFocus event");
}

public void lostFocus() {
System.out.println("lostFocus event");
}

public boolean processKeyEvent(Event e, int x) {
System.out.println("keyDown event");
return true;
}

}


Cheers Paul
Sign In or Register to comment.