Java Q&A

by Mike Jennings



Listing One

<html>

<head>

<title>

SwingSet2

</title>

</head>

<body>



<center>



<SCRIPT LANGUAGE="JavaScript">

<!--

    var _info = navigator.userAgent; var _ns = false;

    var _ie = (_info.indexOf("MSIE") > 0 && _info.indexOf("Win") > 

                             0 && _info.indexOf("Windows 3.1") < 0);

//-->

</SCRIPT>



<COMMENT>

<SCRIPT LANGUAGE="JavaScript1.1">

<!--

    var _ns = (navigator.appName.indexOf("Netscape") >= 0 && 

           ((_info.indexOf("Win") > 0 && _info.indexOf("Win16") < 0 && 

           java.lang.System.getProperty("os.version").indexOf("3.5") < 0) || 

           (_info.indexOf("Sun") > 0) || (_info.indexOf("Linux") > 0)));

    var _ns6 = ((_ns == true) && (_info.indexOf("Mozilla/5") >= 0));

//-->

</SCRIPT>

</COMMENT>



<SCRIPT LANGUAGE="JavaScript">

<!--

  var i;

  var _name="SwingSet2";

  var _codebase=".";

  var NN=(document.layers ? true : false);

  var _embedtype="application/x-java-applet;version=1.3";

  var _classid="clsid:8AD9C840-044E-11D1-B3E9-00805F499D93";

  var _iecodebase="http://southgatesoftware.com/javaplugin/1.3/

                              jinstall-131-win32.cab#Version=1,3,0,0";

  var _nspluginspage="http://home.netscape.com/plugins/jvm.html";

  var _width="100%";

  var _height="100%";

  var _class="SwingSet2Applet";

  var _align="center";

  var _vspace=0;

  var _hspace=0;

  var _jarfiles="SwingSet2.jar";

  var scrap,scrap2;

  var appletProps=new Array();

  var appletValues=new Array();

  appletProps[0]='connectstring';     

  appletValues[0]="xyz";



if (_ie == true)

  {

    document.writeln('<OBJECT classid="'+_classid+'" ');

    document.writeln('WIDTH='+_width+' HEIGHT='+_height);

    document.writeln('NAME='+_name+' ALIGN='+_align);

    document.writeln('VSPACE='+_vspace+' HSPACE='+_hspace);

    document.writeln('codebase="'+_iecodebase+'">');

    document.writeln('<PARAM NAME=CODE VALUE="'+_class+'" >');

    document.writeln('<PARAM NAME=CODEBASE VALUE="'+_codebase+'" >');

    document.writeln('<PARAM NAME="cache_option" VALUE="Plugin">');

    document.writeln('<PARAM NAME="cache_archive" VALUE="'+_jarfiles+'">');

    document.writeln('<PARAM NAME="NAME" VALUE="'+_name+'" >');

    document.writeln('<PARAM NAME="type" 

                          VALUE="application/x-java-applet;version=1.3">');

    document.writeln('<PARAM NAME="scriptable" VALUE="true">');

    document.writeln('<PARAM NAME="mayscript" VALUE="true">');

    for (i=0;i<appletProps.length;i++)

     {

      scrap='<PARAM NAME="'+appletProps[i]+'" VALUE="'+appletValues[i]+'" >';

      document.writeln(scrap);

     }

  }

else if (_ns == true)

  {

    if (_ns6 == true)

      {

        document.writeln('<APPLET ');

        document.writeln('CODE = "'+_class+'" ');

        document.writeln('CODEBASE = "'+_codebase+'" ');

        document.writeln('ARCHIVE = "'+_jarfiles+'" ');

        document.writeln('WIDTH='+_width+' ');

        document.writeln('HEIGHT='+_height+' ');

        document.writeln('ALIGN='+_align+' ');

        document.writeln('VSPACE = '+_vspace+' HSPACE = '+_hspace);

        document.writeln('>');

        for (i=0;i<appletProps.length;i++)

          {

            scrap='<PARAM NAME="'+appletProps[i]+'" 

                                           VALUE="'+appletValues[i]+'" >';

            document.writeln(scrap);

          }

        document.writeln('</applet>');

      }

    else

      {

        document.writeln('<EMBED type="'+_embedtype+'"  ');

        document.writeln('CODE = "'+_class+'" ');

        document.writeln('CODEBASE = "'+_codebase+'" ');

        document.writeln('NAME = "'+_name+'" ');

        document.writeln('WIDTH='+_width+' HEIGHT='+_height+' 

                                                ALIGN='+_align+' ');

        document.writeln('VSPACE = '+_vspace+' HSPACE = '+_hspace);

        document.writeln('cache_option="Plugin" ');

        document.writeln('cache_archive="'+_jarfiles+'" ');

        document.writeln('scriptable=true ');

        document.writeln('mayscript=true ');

        for (i=0;i<appletProps.length;i++)

          {

            scrap=appletProps[i]+'="'+appletValues[i]+'" ';

            document.writeln(scrap);   

          }

        document.writeln('pluginspage="'+_nspluginspage+'">');

        document.writeln('<NOEMBED>');

      }

  }

//-->

</SCRIPT>

</NOEMBED>

</EMBED>

</OBJECT>



</center>

You should see a test applet above

</body>

</html>



Listing Two

signcode -v c:\mykey.pvk -spc c:\mycert.spc file.cab -t 

                        http://timestamp.verisign.com/scripts/timstamp.dll 







1



