Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8332549
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T02:45:21+00:00 2026-06-09T02:45:21+00:00

I have a folder with two files inside; the java .class file and the

  • 0

I have a folder with two files inside; the java .class file and the .html file. In my html file I call the .class file as an applet but it sais an error on the website its published to saying it can’t find the .class file. This puzzles me since they are in the same directory and I triple checked for spelling errors.

Here is my .html file…

<html>

<head>
<title>Applet</title>
</head>

<body>
Program<br />
<applet code="testing.class" width="300" height="300"/>
</body>

</html>

and here is my .class file…

import java.awt.Color;
import java.awt.Graphics;


public class testing extends java.applet.Applet{

    public void init(){

    }

    public void paint(Graphics g){
        g.drawOval(0,0,250,100);
        g.setColor(Color.RED);
        g.drawString("My Applet",10,50);
    }

}

My .class file is “testing.class” and my html file is “testingpage.html”

Here is the Full Entire error

load: class testing.class not found.
java.lang.ClassNotFoundException: testing.class
    at sun.plugin2.applet.Applet2ClassLoader.findClass(Applet2ClassLoader.java:252)
    at sun.plugin2.applet.Plugin2ClassLoader.loadClass0(Plugin2ClassLoader.java:249)
    at sun.plugin2.applet.Plugin2ClassLoader.loadClass(Plugin2ClassLoader.java:179)
    at sun.plugin2.applet.Plugin2ClassLoader.loadClass(Plugin2ClassLoader.java:160)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
    at sun.plugin2.applet.Plugin2ClassLoader.loadCode(Plugin2ClassLoader.java:690)
    at sun.plugin2.applet.Plugin2Manager.createApplet(Plugin2Manager.java:3045)
    at sun.plugin2.applet.Plugin2Manager$AppletExecutionRunnable.run(Plugin2Manager.java:1497)
    at java.lang.Thread.run(Thread.java:680)
Exception: java.lang.ClassNotFoundException: testing.class
load: class testing.class not found.
java.lang.ClassNotFoundException: testing.class
    at sun.plugin2.applet.Applet2ClassLoader.findClass(Applet2ClassLoader.java:252)
    at sun.plugin2.applet.Plugin2ClassLoader.loadClass0(Plugin2ClassLoader.java:249)
    at sun.plugin2.applet.Plugin2ClassLoader.loadClass(Plugin2ClassLoader.java:179)
    at sun.plugin2.applet.Plugin2ClassLoader.loadClass(Plugin2ClassLoader.java:160)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
    at sun.plugin2.applet.Plugin2ClassLoader.loadCode(Plugin2ClassLoader.java:690)
    at sun.plugin2.applet.Plugin2Manager.createApplet(Plugin2Manager.java:3045)
    at sun.plugin2.applet.Plugin2Manager$AppletExecutionRunnable.run(Plugin2Manager.java:1497)
    at java.lang.Thread.run(Thread.java:680)
Exception: java.lang.ClassNotFoundException: testing.class
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-09T02:45:23+00:00Added an answer on June 9, 2026 at 2:45 am

    The applet tag should be:

    <applet code=testing.class width="300" height="300" />
    

    Notice the change in the code attribute. Compare to the example code listed in the relevant Java Tutorial:

    <applet code=Applet1.class width="200" height="200">
    Your browser does not support the <code>applet</code> tag.
    </applet> 
    

    The following is working for me.

    http://puu.sh/PebS

    TestingApplet.java

    import java.applet.Applet;
    
    import java.awt.Color;
    import java.awt.Graphics;
    
    public final class TestingApplet extends Applet {
    
      public void paint(final Graphics g){
        g.drawOval(0, 0, 250, 100);
        g.setColor(Color.RED);
        g.drawString("My Applet", 10, 50);
      }
    }
    

    testing-applet.html

    <html>
      <head>
        <title>Applet</title>
      </head>
      <body>
        Program <br />
        <applet code=TestingApplet.class width="300" height="300" />
      </body>
    </html>
    

    If this is not working, I have two questions for you…

    • Did you save the Java as a .java file and compile it to produce the correct .class file?

    • Did you verify your browser is not caching an old incorrect version of the .html file?

    • Are your .class and .html files in the same directory?

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Suppose i have one folder and inside that another two files are there .
I have a folder with two files: Awesome.File.20091031_123002.txt Awesome.File.Summary.20091031_123152.txt Additionally, a third-party app handles
I have three files in a folder 'test' one.php two.php print.html And i have
I have two .ascx files in the same folder in an ASP.NET MVC project.
I have two tables: Folder, Files. Each table has 4 fields: ParentID, ID, Name,
Have two folders with approx. 150 java property files. In a shell script, how
In my project I have two file .txt (in Resources folder), how can I
I have a products.jar file. Inside that there is one class com.ClassA . The
I have a class file stored in the app code folder. A certain page
I have a website file/folder structure template to start using with git . It

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.