summaryrefslogtreecommitdiffstats
path: root/www/applettest-jnlp.html
blob: 3178cceaff4ee5bfa920efa5d06ff4f15da403f6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title>JOGL JNLP Applet Test</title>
</head>
<body>

<P>
In case your <a href="https://jdk6.dev.java.net/plugin2/jnlp/">Java Plugin supports JNLP</a>, 
the <em>applet-gears.jnlp</em> is used, 
otherwise it shall fallback to <a href="http://jogamp.org/applet-launcher/www/">JNLPAppletLauncher</a>.
</P>

<P>
Note that it is important for the startup time to have the same JVM arguments in the applet tags,
as well as within the JNLP applet description, here see property <em>sun.java2d.noddraw</em>. <br>
Only if JVM arguments of the JNLP applet description are satisfied by the applet tag's JVM,<br>
the plugin will not need to start a new JVM. OF course, the applet tag's JVM spec may exceed the
JNLP applet's one.
</P>

<P>

<applet code="org.jdesktop.applet.util.JNLPAppletLauncher"
      width=600
      height=400
      archive="http://jogamp.org/deployment/util/applet-launcher.jar,
               http://jogamp.org/deployment/webstart/newt.all.jar,
               http://jogamp.org/deployment/webstart/nativewindow.all.jar,
               http://jogamp.org/deployment/webstart/jogl.all.jar,
               http://jogamp.org/deployment/webstart/gluegen-rt.jar,
               http://jogamp.org/deployment/webstart/jogl-demos.jar">
   <param name="codebase_lookup" value="false">
   <param name="subapplet.classname" value="demos.applets.GearsApplet">
   <param name="subapplet.displayname" value="JOGL Gears Applet">
   <param name="noddraw.check" value="true">
   <param name="progressbar" value="true">
   <param name="jnlpNumExtensions" value="1">
   <param name="jnlpExtension1"
          value="http://jogamp.org/deployment/webstart/jogl-core.jnlp">
   <param name="java_arguments" value="-Dsun.java2d.noddraw=true">
   <param name="jnlp_href" value="applet-gears.jnlp">
</applet>

</P>
<P>

The applet above is instantiated with the following code:

<pre>
&lt;applet code="org.jdesktop.applet.util.JNLPAppletLauncher"
      width=600
      height=400
      archive="http://jogamp.org/deployment/util/applet-launcher.jar,
               http://jogamp.org/deployment/webstart/nativewindow.all.jar,
               http://jogamp.org/deployment/webstart/jogl.all.jar,
               http://jogamp.org/deployment/webstart/gluegen-rt.jar,
               http://jogamp.org/deployment/webstart/jogl-demos.jar"&gt;
   &lt;param name="codebase_lookup" value="false"&gt;
   &lt;param name="subapplet.classname" value="demos.applets.GearsApplet"&gt;
   &lt;param name="subapplet.displayname" value="JOGL Gears Applet"&gt;
   &lt;param name="noddraw.check" value="true"&gt;
   &lt;param name="progressbar" value="true"&gt;
   &lt;param name="jnlpNumExtensions" value="1"&gt;
   &lt;param name="jnlpExtension1"
          value="http://jogamp.org/deployment/webstart/jogl-core.jnlp"&gt;
   &lt;param name="java_arguments" value="-Dsun.java2d.noddraw=true"&gt;
   &lt;param name="jnlp_href" value="applet-gears.jnlp"&gt;
&lt;/applet&gt;
</pre>

Where the referenced JNLP file <em>applet-gears.jnlp</em> looks as follow:

<pre>
&lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;jnlp href="applet-gears.jnlp"&gt;
  &lt;information&gt;
    &lt;title&gt;JOGL JNLP Applet Gears Demo&lt;/title&gt;
    &lt;vendor&gt;JogAmp Community&lt;/vendor&gt;
    &lt;homepage href="http://jogamp.org/jogl-demos/"/&gt;
    &lt;description&gt;Gears Demo&lt;/description&gt;
    &lt;description kind="short"&gt;Brian Paul's Gears demo ported to Java and JOGL.&lt;/description&gt;
    &lt;offline-allowed/&gt;
  &lt;/information&gt;

    &lt;resources&gt;
      &lt;j2se href="http://java.sun.com/products/autodl/j2se" version="1.4+"/&gt;
      &lt;property name="sun.java2d.noddraw" value="true"/&gt;
      &lt;jar href="http://jogamp.org/deployment/webstart/jogl-demos.jar" main="true"/&gt;
      &lt;jar href="http://jogamp.org/deployment/webstart/jogl-demos-util.jar"/&gt;
      &lt;extension name="newt-all-awt" href="http://jogamp.org/deployment/webstart/newt-all-awt.jnlp" /&gt;
    &lt;/resources&gt;

  &lt;applet-desc 
      name="Gears-Applet"
      main-class="demos.applets.GearsApplet"
      width="640" 
      height="480"&gt;
  &lt;/applet-desc&gt;
&lt;/jnlp&gt;
</pre>

</P>
<P>

Note that the jogl-demos.jar, which contains the GearsApplet class,
<B>does not need to be signed</B>! JogAmp Community signs
applet-launcher.jar, jogl.jar and gluegen-rt.jar, which contain the
JNLPAppletLauncher and JOGL's supporting classes; this is the only
Java code which needs to be signed in order to deploy applets using
JOGL and is the only certificate the end user must accept.

</P>
<P>

The <a href="http://jogamp.org/applet-launcher/www/">JNLPAppletLauncher
home page</a> contains more information about what files must be
placed on the web server in order to enable the deployment of applets
using JOGL and other extensions.

</P>

</body>
</html>