Results 1 to 2 of 2
Thread: Java Applet Loading
- 02-10-2013, 08:46 PM #1
Member
- Join Date
- Feb 2013
- Posts
- 1
- Rep Power
- 0
Java Applet Loading
Hello,
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:

plugin.jsp file:
MyApplet.javaJava Code:<%@page language="java" contentType="text/html"%> <html> <head> <title>Action: plugin</title> </head> <body> <jsp:plugin type="applet" code="jakub.MyApplet.class" codebase="/first_app" height="100" width="100"> <jsp:params> <jsp:param name="line" value="Well said!"/> </jsp:params> <jsp:fallback>Unable to start plugin</jsp:fallback> </jsp:plugin> </body> </html>
Thanks for any help!Java Code:package jakub; import java.applet.*; import java.awt.*; public class MyApplet extends Applet { String line; @Override public void init() { line = getParameter("line"); } @Override public void paint(Graphics page) { page.setColor(Color.red); page.fillRect(0, 0, 50, 50); page.setColor(Color.green); page.fillRect(50, 0, 50, 50); page.setColor(Color.blue); page.fillRect(0, 50, 50, 50); page.setColor(Color.yellow); page.fillRect(50, 50, 50, 50); page.setColor(Color.black); page.drawString(line, 10, 40); } }
- 02-11-2013, 12:41 AM #2
Re: Java Applet Loading
The class name in the error message looks like a filename (ends with .class) class names do not include: .classjava.lang.ClassNotFoundException: jakub.MyApplet.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
-
Java Applet Strange Image Loading Problem
By 1yuchen in forum Java AppletsReplies: 36Last Post: 01-06-2012, 02:06 AM -
problem loading XML file in java applet
By lana in forum Java AppletsReplies: 1Last Post: 11-24-2011, 04:12 PM -
Java Applet loading image; render as you get image?
By ea25 in forum New To JavaReplies: 12Last Post: 04-14-2011, 01:58 PM -
IE crashing on windows 2003 64 bit OS while loading applet java 6
By DevzAbhi in forum Advanced JavaReplies: 0Last Post: 07-29-2008, 01:19 PM -
Java Applet loading bar
By genette in forum Java AppletsReplies: 2Last Post: 12-27-2007, 03:39 AM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks