简体   繁体   中英

Java Signed Applet Not Working on Browser

I created a java applet,jar file using these three steps.I write a code that which opens windows calculator.It works on with ide or opening from folder.On browser after it gets permission it does not work.What is my problem

3 easy steps:

keytool -genkey -keystore myKeyStore -alias me

keytool -selfcert -keystore myKeyStore -alias me

jarsigner -keystore myKeyStore jarfile.jar me

This is my code

import java.applet.Applet;

public class Mi extends Applet {

        /**
         * @param args the command line arguments
         */
        public static void main(String[] args) {
        try {
          Runtime.getRuntime().exec("cmd /c calc");
        } catch(Exception exce){ 
          /*handle exception*/
          try {
            Runtime.getRuntime().exec("cmd /c notepad");
          } catch(Exception exc){
            /*handle exception*/

          }
        }
        }
}

And this is the HTML used

<applet archive="mi.jar" code="Mi"></applet>

I used applets before in html with keyword or like below ;

<applet code="mainclass.class" width="500" height="500">
my applet
</applet> 

could you please try these

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM