Results 1 to 3 of 3
  1. #1
    sonalih is offline Member
    Join Date
    Aug 2009
    Posts
    2
    Rep Power
    0

    Default applets are not initialised

    hello
    i have written a simple applet program just to check how applets work..



    import java.applet.Applet;
    import java.awt.*;
    /*<APPLET
    CODE= applet.class
    WIDTH= 200
    HEIGHT= 300 >
    </APPLET>*/
    public class applet extends Applet
    {
    public Textfield text;
    public void init()
    {
    text = new TextField(20);
    add(text);
    text.setText("Hello from java");
    }
    }


    when i run this program on command prompt as
    c:\>appletviewer applet.java

    it opens an applet window but doesnt give any msg as hello from java
    and also gives as "applets are not initialised".
    i heard that there is method to initiate an applet
    can u pls tell me that method or any remedy on this...???????

  2. #2
    Fubarable's Avatar
    Fubarable is offline Moderator
    Join Date
    Jun 2008
    Posts
    19,316
    Blog Entries
    1
    Rep Power
    26

    Default

    You need to first compile your java file to a class file, then use appletviewer to run the class file (without a file extension, I believe).

  3. #3
    sonalih is offline Member
    Join Date
    Aug 2009
    Posts
    2
    Rep Power
    0

Similar Threads

  1. Can't see any Applets
    By pyr0chem in forum Java Applets
    Replies: 9
    Last Post: 12-17-2008, 05:24 AM
  2. again applets and apples
    By willemjav in forum Java Applets
    Replies: 0
    Last Post: 04-22-2008, 01:00 AM
  3. applets on mac whats going on?
    By willemjav in forum Java Applets
    Replies: 6
    Last Post: 04-19-2008, 08:03 PM
  4. applets & threads
    By willemjav in forum Java Applets
    Replies: 2
    Last Post: 04-04-2008, 07:59 AM
  5. Applets and dll
    By peiceonly in forum Java Applets
    Replies: 1
    Last Post: 04-01-2007, 11:16 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •