• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Running an applet by clicking a Button on HTML page

 
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
Can any one of you tell me how to start an applet running by clicking a hyperlink or a button on a HTML page? I think this is possible.I will be glad if any one can give a small piece of code which does this.
Thank You.
 
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Try calling a javascript function on "onClick" event of the button.
Inside the function do as follows:
top.frameName.document.write('<APPLET WIDTH=100
HEIGHT=100
NAME="appletname"
CODE="appletname.class"
</APPLET>');
Here frameName indicates the frame where you want the applet to run.
You can also run the applet on a new window as follows:
Inside the function:
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="appletname"
CODE="appletname.class"
</APPLET>');
Hope this solves your purpose.
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic