Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8101508

Add support for 100% width and height applets

XMLWordPrintable

      I think its a really common case to want a applet to fill the whole browser window. This is hard to achieve today using the current packager and templates. I would even go to say that this should be the default for all applets we generate from Netbeans/packager.

      Attached is the HTML template that works in Firefox 6, Chrome and IE 8 & 9. It should hopefully work on most other browsers to. You will also need to set the applet size for fx:deploy to 100x100 and include the workaround for now to change "100" to "100%";
       
              <fx:deploy width="100" height="100"
                        outdir="${basedir}/${dist.dir}" embedJNLP="true"
                        outfile="${application.title}">
                  <fx:application refId="ensemble"/>
                  <template file="${basedir}/web/index_template.html"
                          tofile="${dist.dir}/index.html"/>
                  <fx:resources>
                      <fx:fileset dir="${basedir}/${dist.dir}"
                                  includes="Ensemble.jar"/>
                  </fx:resources>
                  <info title="Sample app: ${application.title}"
                        vendor="${application.vendor}"/>
              </fx:deploy>
              
              <!-- Workaround for bug with 100% size in templates -->
              <replace dir="${basedir}/${dist.dir}">
                  <include name="index.html"/>
                  <replacetoken><![CDATA[: 100,]]></replacetoken>
                  <replacevalue><![CDATA[: '100%',]]></replacevalue>
              </replace>

            igor Igor Nekrestyanov (Inactive)
            jasper Jasper Potts (Inactive)
            Votes:
            4 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported: