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!


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) {
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.