• 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
  • Ron McLeod
  • Paul Clapham
  • Bear Bibeault
  • Junilu Lacar
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
Bartenders:
  • Scott Selikoff
  • Piet Souris
  • Carey Brown

Running an applet by clicking a Button on HTML page

 
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • 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
  • 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.
 
    Bookmark Topic Watch Topic
  • New Topic