File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Applets and the fly likes Embedding a applet in my website Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Applets
Bookmark "Embedding a applet in my website" Watch "Embedding a applet in my website" New topic
Author

Embedding a applet in my website

gowtham potter
Greenhorn

Joined: Nov 02, 2010
Posts: 27

Hai
I want to embed an applet in my website(blog)[from blogspot]
As blogger doesn't support file upload, i want to know how to add a applet to my website. i.e where to upload the class files and how to embed

i tried this but it did not work

<span style="color: red; font-family: 'Comic Sans MS';">


<applet code="http://puzzle.dl.sourceforge.net/project/javaapp/banner.class" height="50" width="300">
</applet> </span>


hai visit my website http://hacktohell.blogspot.com
for tech tips & tricks
Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 18649
    
    8

You didn't say what "did not work" really meant. Read this link: ItDoesntWorkIsUseless

Anyway I put your applet element into a trivial HTML file and opened it in my browser. The applet loaded and then it turned into a box which said "Error. Click for details." So I did, and the Java console opened and showed me the stack trace of the error. You should look in the Java console too.
gowtham potter
Greenhorn

Joined: Nov 02, 2010
Posts: 27

i too got the applet saying error click for details and in the java console found some glibberish plez explain
Ernest Friedman-Hill
author and iconoclast
Marshal

Joined: Jul 08, 2003
Posts: 24187
    
  34

gowtham sundaar wrote:i too got the applet saying error click for details and in the java console found some glibberish plez explain


To a Java programmer, it's not gibberish, but what you're saying is that you're not one, correct?

Read this to understand how to modify your applet tag to point to an applet that's not located on your server:

http://download.oracle.com/javase/1.4.2/docs/guide/misc/applet.html


[Jess in Action][AskingGoodQuestions]
Hetul Himatlal
Greenhorn

Joined: Nov 04, 2010
Posts: 3
Hi gowtham sundaar,

I found a way to post a applet to a blog from blospot. I was also searching for a solution and found one.

I developed my applet using Netbeans IDE and when I built it, netbeans generated 4 files: a html, a jar, a txt and a jnpl.

My main problem was also where to upload the files, and after doing some research on the internet I found that it is possible to post files to google sites creating a new site associated to your Google account, and a page for holding files. After that just upload the jar and the jnpl files. Then edit the the html file, changing the url for the jar and the jnpl files and ponting them to the google site upoloaded files urls. Run the html file on your dektop and see if it works. After that copy the content from the html file to your blog and post it.

Take a look to my Roman to Numeral applet at:

http://3hconsulting.blogspot.com/2010/11/creating-applet-for-roman-to-numeral.html

If you have any doubt or question please fell free to contact. I will update the content of my blog post adding some more details.

Hetul


Hetul H. H.
http://3hconsulting.blogspot.com/
Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 18649
    
    8

That may be all true, but gowtham's main problem is that he just didn't upload all the necessary classes. The applet would have worked just fine if all the classes were in place. I assume he is now looking for the programmer to help him diagnose that problem.
Hetul Himatlal
Greenhorn

Joined: Nov 04, 2010
Posts: 3
Please post the error...
gowtham potter
Greenhorn

Joined: Nov 02, 2010
Posts: 27

<script>
var attributes = {
code: "JAppletRC",
archive: "https://sites.google.com/site/3hadvisory/files/RomanNumeral.jar?attredirects=0&d=1",
width: 275,
height: 175
};
var parameters = {jnlp_href:"https://sites.google.com/site/3hadvisory/files/launch.jnlp?attredirects=0&d=1"}; <!-- Applet Parameters -->
var version = "1.5"; <!-- Required Java Version -->
deployJava.runApplet(attributes, parameters, version);

</script></div>


Hetul Himatlal ,how do i launch a applet without the jnpl file,i.e with only the class file.
Anyway thanks! i will work it out
Thank YOU so much it works!!! at last
http://www.gowtham1.co.cc/2010/06/java-banner-applet.html
this link explained it all http://download.oracle.com/javase/1.4.2/docs/guide/misc/applet.html
i forgot to add codebase
gowtham potter
Greenhorn

Joined: Nov 02, 2010
Posts: 27

Applet Embedding

This explains it all
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Embedding a applet in my website