Results 1 to 7 of 7
- 05-31-2012, 11:29 PM #1
Member
- Join Date
- May 2012
- Posts
- 18
- Rep Power
- 0
load uploaded java class using html?
Hello, I know hoe to open my java program using the <applet> tag on html, but how do I upload my .class onto a website and open it using html?
This is the code I have so far
ThanksXML Code:<html> <body> <applet code="onepiecetest1234.weebly.com/uploads/1/2/3/5/12356816/onepiecelobby.class" width="600" height="400"> </applet> </body> </html>
Edit:I've searched online and read books but they all just show how to do this:
which works but is now what I wanted.XML Code:<html> <body> <applet code="OnePieceLobby.class" width="600" height="400"> </applet> </body> </html>Last edited by MarioBrawler; 05-31-2012 at 11:31 PM.
- 06-01-2012, 04:03 AM #2
Re: load uploaded java class using html?
I'm not sure I understand what you are trying to do. Have you read the doc for the definitions of the <APPLET tag's attribute fields? Does the doc say anything like what you are trying to do?
You can't make things up, you can only do what the doc says the <APPLET tag will do.If you don't understand my response, don't ignore it, ask a question.
- 06-01-2012, 04:10 AM #3
Senior Member
- Join Date
- Jun 2007
- Location
- Bali, Indonesia
- Posts
- 696
- Rep Power
- 6
Re: load uploaded java class using html?
You can use the codebase attribute to tell where the applet class can be found. So you have to configure your applet tag into something like:
<applet codebase="/uploads/1/2/3/5/12356816/" code="package.SomeApplet"/>Last edited by wsaryada; 06-01-2012 at 05:46 AM.
Website: Learn Java by Examples
- 06-01-2012, 04:38 AM #4
Member
- Join Date
- May 2012
- Posts
- 18
- Rep Power
- 0
Re: load uploaded java class using html?
Alright but what happened to the onepiecetest1234.weebly.com/ at the codebase before /uploads/1/2/3/5/12356816/?
Also, I've done more research and am using this code
So this works when I save it in notepad as .htmlXML Code:<html> <body> <applet archive="bloonga.com/cizzdm7wk4t8/" code="Lobby.class"width="770" height="560"> </applet> </body> </html>
But when I try to use the code on a web browser, it doesn't work and returns with this error:
Java Plug-in 1.6.0_32
Using JRE version 1.6.0_32-b05 Java HotSpot(TM) Client VM
User home directory = C:\Users\Aladdin
----------------------------------------------------
c: clear console window
f: finalize objects on finalization queue
g: garbage collect
h: display this help message
l: dump classloader list
m: print memory usage
o: trigger logging
q: hide console
r: reload policy configuration
s: dump system and deployment properties
t: dump thread list
v: dump thread stack
x: clear classloader cache
0-5: set trace level to <n>
----------------------------------------------------
load: class Lobby.class not found.
java.lang.ClassNotFoundException: Lobby.class
at sun.plugin2.applet.Applet2ClassLoader.findClass(Un known Source)
at sun.plugin2.applet.Plugin2ClassLoader.loadClass0(U nknown Source)
at sun.plugin2.applet.Plugin2ClassLoader.loadClass(Un known Source)
at sun.plugin2.applet.Plugin2ClassLoader.loadClass(Un known Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.plugin2.applet.Plugin2ClassLoader.loadCode(Unk nown Source)
at sun.plugin2.applet.Plugin2Manager.createApplet(Unk nown Source)
at sun.plugin2.applet.Plugin2Manager$AppletExecutionR unnable.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Exception: java.lang.ClassNotFoundException: Lobby.class
- 06-01-2012, 04:47 AM #5
Re: load uploaded java class using html?
The browser/java program is looking for a class named: Lobby.class. That looks like a filename, not a class name. Try removing the .class to get the class name.class Lobby.class not found.If you don't understand my response, don't ignore it, ask a question.
- 06-01-2012, 04:55 AM #6
Member
- Join Date
- May 2012
- Posts
- 18
- Rep Power
- 0
Re: load uploaded java class using html?
I've tried that
Still doesn't seem to work :/ Idk why but it works if I save the code as html on notepad and open it from there.load: class Lobby not found.
java.lang.ClassNotFoundException: Lobby
at sun.plugin2.applet.Applet2ClassLoader.findClass(Un known Source)
at sun.plugin2.applet.Plugin2ClassLoader.loadClass0(U nknown Source)
at sun.plugin2.applet.Plugin2ClassLoader.loadClass(Un known Source)
at sun.plugin2.applet.Plugin2ClassLoader.loadClass(Un known Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.plugin2.applet.Plugin2ClassLoader.loadCode(Unk nown Source)
at sun.plugin2.applet.Plugin2Manager.createApplet(Unk nown Source)
at sun.plugin2.applet.Plugin2Manager$AppletExecutionR unnable.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Exception: java.lang.ClassNotFoundException: Lobby
- 06-01-2012, 05:02 AM #7
Similar Threads
-
Could not find or load main class: c:\java\HelloWorldApp
By Atticus in forum New To JavaReplies: 10Last Post: 02-02-2012, 08:26 PM -
Error: Could not find or load main class Ops.java
By Javasubbu in forum New To JavaReplies: 4Last Post: 10-05-2011, 10:52 PM -
load graphics in html page using jsp and database
By charu in forum JavaServer Pages (JSP) and JSTLReplies: 0Last Post: 03-04-2009, 07:12 PM -
how to load a java class in startup
By leonard in forum Advanced JavaReplies: 1Last Post: 08-06-2007, 03:36 AM -
how to load a html document
By boy22 in forum Java ServletReplies: 1Last Post: 08-05-2007, 04:12 AM


1Likes
LinkBack URL
About LinkBacks
Reply With Quote

Bookmarks