public field of java can be passed to javascript.example:public class Test extends JApplet
{
  public int x = 10 ;
  .......  

.....
//html
<html>
...
<script language = "JavaScript">
   alert(document.TestApplet.x);
</script>
...
<applet name="TestApplet" code=Test.class width=100 height=100>
</applet>
....
</htmL>