Java Beginners

Moderators: zibadian
Number of threads: 1233
Number of posts: 2675

This Forum Only
Post New Thread
Single Post View       Linear View       Threaded View      f

Report
Why doesn't my applet work Posted by RED4RUM on 25 Oct 2011 at 7:33 PM
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



 

Recent Jobs

Official Programmer's Heaven Blogs
Web Hosting | Browser and Social Games | Gadgets

Popular resources on Programmersheaven.com
Assembly | Basic | C | C# | C++ | Delphi | Flash | Java | JavaScript | Pascal | Perl | PHP | Python | Ruby | Visual Basic
© Copyright 2011 Programmersheaven.com - All rights reserved.
Reproduction in whole or in part, in any form or medium without express written permission is prohibited.
Violators of this policy may be subject to legal action. Please read our Terms Of Use and Privacy Statement for more information.
Operated by CommunityHeaven, a BootstrapLabs company.