Home Articles FAQs XREF Games Software Instant Books BBS About FOLDOC RFCs Feedback Sitemap
irt.Org
#

Q4059 How do I pass a variables value from an Applet to HTML and vice versa?

You are here: irt.org | FAQ | Java | Q4059 [ previous next ]

All you can do is you can access the public variable of an applet which is downloaded. Using JavaScript you can access the public variable of the Java applet:

public class xyz extends java.applet.Applet
{
  public int x = 10 ;
  public void init()
  {
  }
} // End of applet code 

Inside the HTML page you can have JavaScript code to access the value of x:

<script language = "JavaScript">
alert(document.xyz.x);
</script>

<applet name="xyz" code="xyz.class" width=100 height=100>
</applet>

Feedback on 'Q4059 How do I pass a variables value from an Applet to HTML and vice versa?'

©2018 Martin Webb