Search code examples
javaeclipseapplet

Using Java.applet.Applet in Eclipse


I am little .NET oriented, and new to Java stuff. Using Eclipse IDE, whenever i extend my class by Applet as:

class xyz extends Applet{ . . . };

this gives error. and no suitable oauto-fix. i tried importing manually as

import java.applet.Applet;

But this gives error too. I tried to look up for the problem over internet, but only find the way to create applet, not the solution. Kindly guide me. Do I have to import some files in my Eclipse IDE?

(i forgot to mention, I am using it in my Android Application Project)


Solution

  • As Mr. Thompson said, applets don't work in android. The tutorial you posted may does some Android stuff later - however not in that specific tutorial you linked ("But wait until we start developing on Android" [...at some day in the future and in some other tutorial]). And as you may see the first screenshot he selects

    "Package Explorer >> New >> Java Project" and not the below Android Application Project.

    So did you really (exactly) followed that tutorial step by step? If so, everything should be working. If not you made a mistake or your eclipse is misconfigured.