Results 1 to 19 of 19
  1. #1
    Ark3 is offline Member
    Join Date
    Jun 2014
    Posts
    43
    Rep Power
    0

    Default Applet Does Not Work... (First Time for Me)

    So, I was making my Applet like the textbook wanted it... and it doesn't work, or at least seems so.
    In addition, I don't know how to compile the Applet either.
    Please Help Me ASAP!
    Here are the Codes and Error Message:
    Applet Does Not Work... (First Time for Me)-error2.png



    Applet Does Not Work... (First Time for Me)-error3.png

  2. #2
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Location
    SW Missouri
    Posts
    17,305
    Rep Power
    25

    Default Re: Applet Does Not Work... (First Time for Me)

    it doesn't work
    Please explain. How are you trying to execute the program?

    When posting code be sure to wrap your code with code tags:
    [code]
    YOUR CODE GOES HERE
    [/code]
    to get highlighting and preserve formatting.


    The message you posted is a warning, not an error, and that specific warning can be ignored.
    If you don't understand my response, don't ignore it, ask a question.

  3. #3
    Ark3 is offline Member
    Join Date
    Jun 2014
    Posts
    43
    Rep Power
    0

    Default Re: Applet Does Not Work... (First Time for Me)

    The Applet is executed in a embedded HTML. (Its embedded on a website)
    It seems like it can't find the Applet... and insists it doesn't exist even though it does...

    Sam Jin

  4. #4
    KevinWorkman's Avatar
    KevinWorkman is offline Crazy Cat Lady
    Join Date
    Oct 2010
    Location
    Washington, DC
    Posts
    3,864
    Rep Power
    8

    Default Re: Applet Does Not Work... (First Time for Me)

    Word to the wise: including demands such as "help me ASAP!" actually hurt your chances of getting help.

    The warning you showed in your screenshot is just a warning and has no impact on compilation errors or runtime exceptions.

    Post the full text of any errors you're getting.
    How to Ask Questions the Smart Way
    Static Void Games - Play indie games, learn from game tutorials and source code, upload your own games!

  5. #5
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    11,792
    Rep Power
    19

    Default Re: Applet Does Not Work... (First Time for Me)

    Also show the full html tag used to embed the applet.
    Please do not ask for code as refusal often offends.

    ** This space for rent **

  6. #6
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Location
    SW Missouri
    Posts
    17,305
    Rep Power
    25

    Default Re: Applet Does Not Work... (First Time for Me)

    Did you try testing from a testing folder on your PC?
    If you don't understand my response, don't ignore it, ask a question.

  7. #7
    Ark3 is offline Member
    Join Date
    Jun 2014
    Posts
    43
    Rep Power
    0

    Default Re: Applet Does Not Work... (First Time for Me)

    Actually, I just created the HTML file from notepad... in addition, it's not actually linked to a web server.

    P.S. what is a testing folder??

    Thanks
    Sam,

  8. #8
    Ark3 is offline Member
    Join Date
    Jun 2014
    Posts
    43
    Rep Power
    0

    Default Re: Applet Does Not Work... (First Time for Me)

    My Textbook says "Embedding an applet in a webpage...... you must Compile your applet" (mine is First_Applet)
    In addition, it lists it as "Applet-Name".java and it turns it into .class.
    Please walk me through the steps.

    Thanks again, for helping me a lot...
    Sam

  9. #9
    Ark3 is offline Member
    Join Date
    Jun 2014
    Posts
    43
    Rep Power
    0

    Default Re: Applet Does Not Work... (First Time for Me)

    The Embedding is:
    Java Code:
    <HR>
          <APPLET CODE="First_Applet.class" WIDTH=300
                                 HEIGHT=60></APPLET>
    
    //REST OF CODE GOES HERE...

  10. #10
    Ark3 is offline Member
    Join Date
    Jun 2014
    Posts
    43
    Rep Power
    0

    Default Re: Applet Does Not Work... (First Time for Me)

    Keep in mind though, I have not compiled it yet to yielding the .class format...
    For I don't know how to, the Textbook is unclear of the process.

  11. #11
    Ark3 is offline Member
    Join Date
    Jun 2014
    Posts
    43
    Rep Power
    0

    Default Re: Applet Does Not Work... (First Time for Me)

    Here is the Code of the Applet in Eclipse...

    Java Code:
    package Applets;
    
    import java.applet.Applet;
    import java.awt.Graphics;
    
    public class First_Applet extends Applet {
    	public void appOne (Graphics a) {
    		a.drawString("This is my First Java Applet, "
    				+ "and I don't know how to run it!", 20, 20);
    	}
    }

  12. #12
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Location
    SW Missouri
    Posts
    17,305
    Rep Power
    25

    Default Re: Applet Does Not Work... (First Time for Me)

    what is a testing folder??
    A folder that is isolated from the IDE so it doesn't use any files except what you have copied to it for testing the html and applet.

    When all the files for the test are in the testing folder, open the html file in a browser and see what happens.

    How is the appOne() method called? I don't see any code in the class that calls it.
    If you don't understand my response, don't ignore it, ask a question.

  13. #13
    Ark3 is offline Member
    Join Date
    Jun 2014
    Posts
    43
    Rep Power
    0

    Default Re: Applet Does Not Work... (First Time for Me)

    In fact, I was going to ask you how the textbook asked me to copy their applet, when the method doesn't even exist...
    appOne()

  14. #14
    Ark3 is offline Member
    Join Date
    Jun 2014
    Posts
    43
    Rep Power
    0

    Default Re: Applet Does Not Work... (First Time for Me)

    What should I do about appOne()?

  15. #15
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Location
    SW Missouri
    Posts
    17,305
    Rep Power
    25

    Default Re: Applet Does Not Work... (First Time for Me)

    You need to read about applets and components to see which ones to override that do what you want.
    Lesson: Java Applets (The Java™ Tutorials > Deployment)

    Why did you code appOne()? Where did you see that?
    If you don't understand my response, don't ignore it, ask a question.

  16. #16
    Ark3 is offline Member
    Join Date
    Jun 2014
    Posts
    43
    Rep Power
    0

    Default Re: Applet Does Not Work... (First Time for Me)

    Oh SHOOT!!!!!!!
    I mistook it for the next line in the coding on the Textbook!!!!!!
    it's supposed to be "paint"...

  17. #17
    Ark3 is offline Member
    Join Date
    Jun 2014
    Posts
    43
    Rep Power
    0

    Default Re: Applet Does Not Work... (First Time for Me)

    Now it's able to be run in Eclipse, but how do I compile the file so I can embed it into the HTML??

  18. #18
    Ark3 is offline Member
    Join Date
    Jun 2014
    Posts
    43
    Rep Power
    0

    Default Re: Applet Does Not Work... (First Time for Me)



    Thanks in Advanced,
    I gotta go eat lunch with my parents....
    But do tell me how to compile the Applet,
    I'll reply back later, in about 30 minutes.
    Thanks again for the tremendous help.

    Sam

  19. #19
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Location
    SW Missouri
    Posts
    17,305
    Rep Power
    25

    Default Re: Applet Does Not Work... (First Time for Me)

    I don't know how to use your IDE.
    I use the javac command to compile all my java programs.
    If you don't understand my response, don't ignore it, ask a question.

Similar Threads

  1. toast wont work in time
    By nour in forum Android
    Replies: 5
    Last Post: 04-11-2012, 09:34 PM
  2. applet call dll work in Win2000 but not work in WinXP
    By manhcuongtin4 in forum Java Applets
    Replies: 1
    Last Post: 07-14-2011, 01:45 PM
  3. Work with TIME
    By Maxwell in forum New To Java
    Replies: 3
    Last Post: 04-16-2011, 03:05 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
  •