• 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

Applet doesn't respond???

 
Ranch Hand
Posts: 138
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi All
I'm trying to run a script when the applet gets downloded,or at least to get respond when i click on it.I can't make that works.
here is my html file and java file:
Html file:
//==============
<html>
<body>
<script language="javascript" >
function show()
{
var y=88;
document.writeln("hello world ");
return y;
}
</script>
<object code="TextFieldApplet10.class" id="matt" width="500" height="200" onLoad="show();" >
</object>
<input type="button" value="Click on me " onClick="alert('Hee hee!');"></a>
</body>
</html>
//=============
Here is the java file"
//=============
import java.awt.*;
import java.applet.*;
public class TextFieldApplet10 extends Applet
{
public void init()
{
TextField txt1 = new TextField(" ");
add(txt1);
}
}
//=============
thanks for your time.
 
Ranch Hand
Posts: 202
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi
The program in the present status shows the applet with the text box you added and gives an alert message "Hee Hee". For your javascript function to work, you will have to call the function.
<input type="button" value="Click on me " onClick="show()">
When you do this "hello world" in a new browser screen.
Suneel
[This message has been edited by Suneel Setlur (edited March 30, 2001).]
 
If I had asked people what they wanted, they would have said faster horses - Ford. Tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic