Applet vs application
Anyone knows is a java applet can control an java application which able to write a text file.
Actually what i need is to change the .txt file contents in the same folder by applet.Let say the user type something on the applet and i want the text to be saved in my folder.
I had tried to use the write file method which has to sign the applet.But this seem like very hard to be done.
method to sign jar
from Deploying Software with JNLP and Java Web Start
1) First, create the JAR file:
jar cf JNLPTime.jar TheTime.class
2) Second, create a key in the keystore (or use one you already have). You'll be prompted for information like first name and last. You should at least fill in that information.
keytool -genkey -keystore myKeys -alias jdc
3) Third, sign the JAR. Be sure to remember your password from the previous step.
jarsigner -keystore myKeys JNLPTime.jar jdc
keytool, jarsigner, jar should find in your jdk/bin/
i try the jarsigner things by compiling the following file,
then create jar file , keystore and follow with the jarsigner but it doesnt work,
for the keystore should i create my own one?im using others that found online...
public class write1 extends JApplet implements ActionListener
String yy = "asdasdada";
public void init()
Container c = getContentPane();
c.setLayout ( new FlowLayout(FlowLayout.LEFT, 20, 20) );
jb1 = new JButton("Blast");
public void actionPerformed(ActionEvent evt)
Writer output1 = null;
String out1 = "this is to try 0ut th things";
File file1 = new File("G://writefileresult.txt");//write file
output1 = new BufferedWriter(new FileWriter(file1,true));
System.out.println("File read error...");