title: Trigger an applet button from javascript
body: <p>i want to trigger an applet button on click of a normal html button using javascript</p>
  
  <pre><code>public class appletToWrite extends Applet{
  Button write;
  static String msPath;
  static String msData;
  public appletToWrite()
  {
      this.write = new Button("Save");
  }
  
  public static void initializeData(String asPath, String asData){
      msPath = asPath;
      msData = asData;
  }
  
  public void init() { 
      add(this.write, "Center");
      this.write.addActionListener(new ActionListener() {
          public void actionPerformed(ActionEvent paramActionEvent) {
              foo();
          }
      }); }
  
  
  public void foo(){
      new appletToWrite.WriteText();
  }
  
  public class WriteText {
      WriteText() {
          try {
              String str2 = "D:\\Documents and Settings\\varun.aggarwal\\Desktop\\sample\\wow.htm";
              File localFile = new File(str2);
              localFile.createNewFile();
              BufferedWriter localBufferedWriter = new BufferedWriter(new FileWriter(localFile, true));
              String str1="helllllllo";
              localBufferedWriter.write(str1);
              localBufferedWriter.close();
              JOptionPane.showMessageDialog(null, "File Successfully Saved!!! ");
  
          }
          catch (Exception localException) {
              JOptionPane.showMessageDialog(null, localException.getMessage());
          }
      }
  }
  </code></pre>
  
  <p>}</p>
  
  <p>is it possible???</p>
  
  <p>this is something related to permissions as i found that file IO permissions are availabale only when i click on applet button and not when i click html button and call the applet method foo</p>