This week's book giveaway is in the Java in General forum.
We're giving away four copies of Think Java: How to Think Like a Computer Scientist and have Allen B. Downey & Chris Mayfield on-line!
See this thread for details.
Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Applet in a Browser

 
Jeremy Hooie
Ranch Hand
Posts: 38
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I, like many others, have an applet, which works fine in AppletViewer, but things go awry when loading in a browser. I know these are stupid questions, but I'm a newbie so bare with me. I have all the necessary classes and the HTML file in the same directory and I have downloaded and installed the Plug-In. If I put the class name in the code value in the HTML file I get the following error:

If I then add the package (DnD) to the code value in the HTML file, it can�t find the class. Has anyone experienced this before and discovered how to fix it?
Jeremy
 
sheetal bhandari
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi
If you have more than one class then put all the classes in a jar file and then read them.It will work fine then
Sheetal
 
Tim Holloway
Saloon Keeper
Pie
Posts: 18152
52
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
When you use a package, you don't put all the classes in the same directory. The directory structure mirrors the package structure. What you needed in your classes directory was a DnD subdirectory containing the ExsequorWeb.class file. And the directory name has to be properly capitalized even under Windows!
 
Jeremy Hooie
Ranch Hand
Posts: 38
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks, Tim. But now I've got another problem. I'm getting a RuntimePermissionException even though I've explicitly added this right in my .java.policy file using the Policy Tool.

Any ideas?
 
Tim Holloway
Saloon Keeper
Pie
Posts: 18152
52
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You have to create a signed JAR. http://java.sun.com/docs/books/tutorial/security1.2/index.html
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic