Results 1 to 2 of 2

Thread: Problem Loading Java Applet{resolved}

  1. #1

    Thread Starter
    Frenzied Member System_Error's Avatar
    Join Date
    Apr 2004
    Posts
    1,111

    Problem Loading Java Applet{resolved}

    I cant get an applet to load that I copied right out of the book I'm learning from.
    My default web browser wont load it but it doesnt say there was any error.
    The appletviewer command line prompt doesnt work either.
    I am almost certain I have the nessacary plugins

    Here is the html code for the web page to show it:

    <applet code=”RootApplet.class” height=100 width=300>
    </applet>

    Here is the code for the Applet

    import java.awt.*;

    public class RootApplet extends javax.swing.JApplet {
    int number;

    public void init() {
    number = 225;
    }

    public void paint(Graphics screen) {
    Graphics2D screen2D = (Graphics2D) screen;
    screen2D.drawString("The square root of " + number + " is " + Math.sqrt(number),5,50);
    }
    }

    Someone please help me!!!!
    Last edited by System_Error; Jun 10th, 2004 at 10:09 AM.

  2. #2
    Fanatic Member
    Join Date
    Jan 2003
    Posts
    1,004
    Check out:

    My webpage

    and view the source of the webpage. The HTML code for viewing the applet is there.
    "Can't" and "shouldn't" are two totally separate things.

    All questions should be answered. All answers should be true. That is why I post.

Posting Permissions

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



Click Here to Expand Forum to Full Width