Reputation: 33
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>
Upvotes: 1
Views: 353
Reputation: 243
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
Upvotes: 1