Results 1 to 2 of 2
  1. #1
    ziraell is offline Member
    Join Date
    Feb 2013
    Rep Power

    Default Java Applet Loading


    I am learning how to embed Java applet into my application, but I am getting java.lang.ClassNotFoundException: jakub.MyApplet.class.

    I use Tomcat and Netbeans 7. Folder structure from Netbeans here:

    Java Applet Loading-screen-shot-2013-02-10-8.41.51-pm.jpg

    plugin.jsp file:

    Java Code:
    <%@page language="java" contentType="text/html"%>
            <title>Action: plugin</title>
            <jsp:plugin type="applet" code="jakub.MyApplet.class" codebase="/first_app" height="100" width="100">
                    <jsp:param name="line" value="Well said!"/>
                <jsp:fallback>Unable to start plugin</jsp:fallback>

    Java Code:
    package jakub;
    import java.applet.*;
    import java.awt.*;
    public class MyApplet extends Applet {
        String line;
        public void init() {
            line = getParameter("line");
        public void paint(Graphics page) {
            page.fillRect(0, 0, 50, 50);
            page.fillRect(50, 0, 50, 50);
            page.fillRect(0, 50, 50, 50);
            page.fillRect(50, 50, 50, 50);
            page.drawString(line, 10, 40);
    Thanks for any help!

  2. #2
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Eastern Florida
    Rep Power

    Default Re: Java Applet Loading

    java.lang.ClassNotFoundException: jakub.MyApplet.class.
    The class name in the error message looks like a filename (ends with .class) class names do not include: .class
    The classname is: jakub.MyApplet so use that in the code= attribute

    what folders are the html file and the .class files in? The .class file should be in the jakub folder.
    If you don't understand my response, don't ignore it, ask a question.

Similar Threads

  1. Java Applet Strange Image Loading Problem
    By 1yuchen in forum Java Applets
    Replies: 36
    Last Post: 01-06-2012, 02:06 AM
  2. problem loading XML file in java applet
    By lana in forum Java Applets
    Replies: 1
    Last Post: 11-24-2011, 04:12 PM
  3. Replies: 12
    Last Post: 04-14-2011, 01:58 PM
  4. Replies: 0
    Last Post: 07-29-2008, 01:19 PM
  5. Java Applet loading bar
    By genette in forum Java Applets
    Replies: 2
    Last Post: 12-27-2007, 03:39 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