Applet

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • dipikaronit
    New Member
    • Mar 2008
    • 5

    Applet

    I have written a programme based on Applet and it Sucessfully compiled but it gives a run time error
    (Exception in thread "main" java.lang.noSuc hMethodError:ma in)

    My code is:

    import java.awt.*;
    import java.applet.*;
    class AppletTest
    {
    public void init()
    {}
    public void stop()
    {}
    public void paint(Graphics g)
    {
    g.drawString("H ello Dipika",20,20);
    g.drawString("H i Dipika",20,40);
    }
    }

    please suggest me to how i can overcome this problem.
  • r035198x
    MVP
    • Sep 2006
    • 13225

    #2
    Originally posted by dipikaronit
    I have written a programme based on Applet and it Sucessfully compiled but it gives a run time error
    (Exception in thread "main" java.lang.noSuc hMethodError:ma in)

    My code is:

    import java.awt.*;
    import java.applet.*;
    class AppletTest
    {
    public void init()
    {}
    public void stop()
    {}
    public void paint(Graphics g)
    {
    g.drawString("H ello Dipika",20,20);
    g.drawString("H i Dipika",20,40);
    }
    }

    please suggest me to how i can overcome this problem.
    How did you try to run it?

    Comment

    • dipikaronit
      New Member
      • Mar 2008
      • 5

      #3
      Originally posted by r035198x
      How did you try to run it?
      After compiling i written this in dos prompt- java AppletTest

      Comment

      • r035198x
        MVP
        • Sep 2006
        • 13225

        #4
        Originally posted by dipikaronit
        After compiling i written this in dos prompt- java AppletTest
        That is how you would run a Java application not an Applet.
        Read the Applet tutorial to find out how applets are deployed.

        Comment

        • JosAH
          Recognized Expert MVP
          • Mar 2007
          • 11453

          #5
          Originally posted by dipikaronit
          I have written a programme based on Applet
          No you haven't. Importing the entire java.applet package doesn't make your class
          automagically extend from the Applet class. Do what r035198x suggested and
          first read a tutorial on the matter.

          kind regards,

          Jos

          Comment

          Working...