Results 1 to 5 of 5

Thread: Appletviewer

  1. #1
    BiCure is offline Member
    Join Date
    Jul 2012
    Posts
    17
    Rep Power
    0

    Default Appletviewer

    I am having some troubles getting the applet viewer to open my first ever attempt. The viewer opens but my file does not open with it.

    Here is the code I am using from the textbook:

    import java.awt.*;
    import java.applet.*;

    /*
    <applet code ="SimpleApplet" width=200 height=60>
    </applet>
    */

    public class SimpleApplet extends Applet {
    public void paint(Graphics g) {
    g.drawString("A Simple Applet", 20, 20);
    }
    }


    I have the directory of the file opened up in command prompt and that is just a notebook file. I typed in appletviewer RunApp.html(name of the file in the directory) and the appletviewer opens but has an error opening my file. The error says "Can't read AppletViewer properties file" then lists a directory. It also has a ClassNotFoundException: SimpleApplet which quite obviously means SimpleApplet was not found when trying to load. Any help would be fantastic, thanks ahead of time.

  2. #2
    DarrylBurke's Avatar
    DarrylBurke is online now Forum Police
    Join Date
    Sep 2008
    Location
    Madgaon, Goa, India
    Posts
    11,458
    Rep Power
    20

    Default Re: Appletviewer

    Forum Rules
    Guide For New Members
    BB Code List - Java Programming Forum

    Have you compiled the class? Your statement
    I typed in appletviewer RunApp.html(name of the file in the directory)
    seems to imply that you have written Java code in a file with a .html extension. Better go through the Tutorial Lesson: Java Applets (The Java™ Tutorials > Deployment)

    db
    If you're forever cleaning cobwebs, it's time to get rid of the spiders.

  3. #3
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    12,224
    Rep Power
    20

    Default Re: Appletviewer

    appletviewer takes an html document generally and displays any APPLET/OBJECT/whatever-the-other-one-is tags.

    BiCure, as Darryl asks, though, have you compiled the SimpleApplet class.
    If so, is the resulting class file in the same directory as the html file you are opening?

    Finally, if you get an error running something it is best to provide the full error message (plus any stack traces) here.
    Please do not ask for code as refusal often offends.

    ** This space for rent **

  4. #4
    BiCure is offline Member
    Join Date
    Jul 2012
    Posts
    17
    Rep Power
    0

    Default Re: Appletviewer

    Thanks for the help, that was definitely my problem. Been a few months since I've done any Java but picking up where I left off from then put my next subject as applets. I did not know I had to compile the SimpleApplet class to run the appletviewer as I've never used it before. Thanks again, I'm sure I'll have more questions in the future as I'm trying to pound out a chapter every week day in this book.

  5. #5
    BiCure is offline Member
    Join Date
    Jul 2012
    Posts
    17
    Rep Power
    0

    Default Re: Appletviewer

    P.S. you must have helped me in the past Tolls because I must spread rep before giving you more.

Similar Threads

  1. Replies: 3
    Last Post: 06-12-2011, 07:07 PM
  2. Replies: 1
    Last Post: 07-27-2009, 12:59 PM
  3. Problem with applet, between appletviewer and browser
    By Goodwine in forum Java Applets
    Replies: 0
    Last Post: 11-30-2008, 04:09 AM
  4. Difference between browswer and appletviewer?
    By jklsemicolon in forum Java Applets
    Replies: 5
    Last Post: 08-09-2008, 06:23 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
  •