View Single Post
  #1 (permalink)  
Old 07-04-2009, 08:11 PM
nishant.4545 nishant.4545 is offline
Member
 
Join Date: Jul 2009
Posts: 10
Rep Power: 0
nishant.4545 is on a distinguished road
Default problem with applet execution
I have made an applet that opens notepad. The code is:
Code:
import java.applet.*;
import java.awt.*;


public class Note extends Applet{
 public void paint(Graphics g) {

g.drawString("Open a notepad",50,10);
try
{
 Runtime r=Runtime.getRuntime();
    	 Process p=null;
    	 	p=r.exec("notepad");
}catch(Exception e){
	g.drawString(e.toString(),50,50);
}
    
}}
Then I have created its jar file using the command

jar cvf Note.jar Note.class

Then I signed this jar file using keytool to give it necessary permisiions using following commands:

keytool -genkey -alias Note -validity 365
jarsigner Note.jar Note

Then I created an html to operate the applet from within the jar file.

My problem is that as the applet starts it opens several (165) instances of notepad. When I clase all those instances, all the instances appear again.
plz help me to understand the problem.
Reply With Quote