Win a copy of JDBC Workbook this week in the JDBC and Relational Databases forum
or A Day in Code in the A Day in Code forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Jeanne Boyarsky
  • Junilu Lacar
  • Henry Wong
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Frits Walraven
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • salvin francis
  • fred rosenberger

Running applet by clicking a hyperlink

 
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I need to run an applet by clicking a hyperlink.The following is the piece of code which i tried.It opens a new window but the applet does not run.

function openAppletWindow() {
var win=window.open("","","location=0,menubar=0,resizable=0,toolbar=0,status=0,height=150,width=500");
win.document.writeln('<APPLET WIDTH=100 HEIGHT=100 NAME="applettohtml.html" CODE="applettohtml.class"</APPLET>');
}
</script>
<p><a href="javascript penAppletWindow()">Click here to start
Applet</a>
</p>

Arul has suggested me on this before.I am new to java and javascript.I dunno whether this is too simple.But i am not able to figure out what is going on...
Thanks.
Srikanth Narra
 
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The above works on a button click. In case of an hyperlink :
First, have an html (called first.html) like this:
<html>
<p><a href="applettohtml.html">Click here to start
Applet</a>
</p>
Next,in applettohtml.html have the code like this:
<html>
<applet code = "applettohtml.class" width = 100 height = 100>
</applet>
</html>
Now, run first.html and click the link to run the applet.
Remember to place first.html,applettohtml.html,applettohtml.class in the same directory.
Try it out and mail me back.
 
srikanth narra
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Arul,
I did it but it is still saying that class not found when the html is run in the browser.I appreciate your willingness to get back to me.
Thanks
Sri Narra.
 
He's my best friend. Not yours. Mine. You can have this tiny ad:
Devious Experiments for a Truly Passive Greenhouse!
https://www.kickstarter.com/projects/paulwheaton/greenhouse-1
    Bookmark Topic Watch Topic
  • New Topic