Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 4 of 4

Thread: Am facing "Applet not initalised" when am compiling basic applet simple program:please help me out ASAP

  1. #1
    Junior Member
    Join Date
    Jul 2013
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Am facing "Applet not initalised" when am compiling basic applet simple program:please help me out ASAP

    wrote the below code and stored it as HelloWorldApplet.java
    import java.applet.*;
    import java.awt.*;

    public class HelloWorldApplet extends Applet
    {
    public void paint (Graphics g)
    {
    g.drawString ("Hello World", 25, 50);
    }
    }

    den gave javac HelloWorldApplet.java,den gave java main:
    Got Exception in thread "main" java.lang.NoClassFoundError:
    wrote HTML code to embed as beow and stored :Main.html

    <html>
    <title>The Hello, World Applet</title>
    <hr>
    <applet code="HelloWorldApplet.class" width="320" height="120">
    If your browser was Java-enabled, a "Hello, World"
    message would appear here.
    </applet>
    <hr>
    </html>

    den applet.html..is created but in the footer ,"applet not intialised...so..no message is displayed in d command


  2. #2
    Crazy Cat Lady KevinWorkman's Avatar
    Join Date
    Oct 2010
    Location
    Washington, DC
    Posts
    5,424
    My Mood
    Hungover
    Thanks
    144
    Thanked 636 Times in 540 Posts

    Default Re: Am facing "Applet not initalised" when am compiling basic applet simple program:please help me out ASAP

    Please see the link in my signature on asking questions the smart way, especially the bit about using proper spelling and grammar.

    Are you trying to run this as an application or an applet? You've posted logic for both, and mixing them doesn't make sense.
    Useful links: How to Ask Questions the Smart Way | Use Code Tags | Java Tutorials
    Static Void Games - Play indie games, learn from game tutorials and source code, upload your own games!

  3. #3
    Junior Member
    Join Date
    Jul 2013
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: Am facing "Applet not initalised" when am compiling basic applet simple program:please help me out ASAP

    Am in hurry ,so used shortforms...ok..will take care..
    yeah , i tried in both the ways...
    Can you please resolve my problem in either ways?

  4. #4
    Crazy Cat Lady KevinWorkman's Avatar
    Join Date
    Oct 2010
    Location
    Washington, DC
    Posts
    5,424
    My Mood
    Hungover
    Thanks
    144
    Thanked 636 Times in 540 Posts

    Default Re: Am facing "Applet not initalised" when am compiling basic applet simple program:please help me out ASAP

    Before we can help you, you have to figure out how you want to run it: is it an application or an applet? It looks like an applet, but you've posted commands that only apply to applications.

    Does the code actually compile? What does that Java Console say when you get the error?
    Useful links: How to Ask Questions the Smart Way | Use Code Tags | Java Tutorials
    Static Void Games - Play indie games, learn from game tutorials and source code, upload your own games!

Similar Threads

  1. Replies: 2
    Last Post: June 22nd, 2013, 10:30 AM
  2. error with "Scanner" class in basic calculator program.
    By wheezebeez in forum What's Wrong With My Code?
    Replies: 4
    Last Post: November 2nd, 2012, 09:49 AM
  3. "Program execution skips the "if" statement"!
    By antony1925 in forum What's Wrong With My Code?
    Replies: 1
    Last Post: May 7th, 2012, 07:15 AM
  4. [SOLVED] Conditional Operator "?:" not compiling
    By mwardjava92 in forum What's Wrong With My Code?
    Replies: 3
    Last Post: November 1st, 2011, 05:40 PM
  5. Replies: 2
    Last Post: October 29th, 2009, 06:13 PM