• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 247
  • Last Modified:

App

How could I open an application (notepad.exe) on a clients machine using a web browser. Is it possible to do this using an applet?
Thanks,
KMurphy
0
kmurphy7
Asked:
kmurphy7
  • 2
  • 2
  • 2
1 Solution
 
dvijiCommented:
   If you want to show the txt file and the file is in the Server use
   AppletContext appletContext = getAppletContext();
   appletContext.showDocument("url","_blank");
It will open and shows that text file in the new window.

   If you want to open the notepad use Runtime.exec("notepad.exe"); Make your applet as trusted one.
Notepad is only in Windows... So before that Check the OS  by using System.getProperty("os.name") and open that default text editor of that OS.

Best of luck...

...dviji

0
 
kmurphy7Author Commented:
So the following should open notepad:

import java.io.*;
import java.util.*;

public class testExeApplet extends java.applet.Applet
{
     Runtime rt = Runtime.getRuntime();
     public void openApp()
     {
          try
          {
               rt.exec("notepad.exe");
          }
          catch( Exception e )
          {
               System.out.println(e);
        }
     }
}
0
 
omry_yCommented:
it will not work.
to run native programs, your applet must be signed.
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
dvijiCommented:
Hi kmurphy7
          If you use Runtime make it as trusted. i.e sign that applet. If you use jdk1.1 use javakey if  your jdk1.2 use keytool and jarsigner. There are set of steps you have to follow.

for surther information goto http://java.sun.com/products/jdk/1.2/docs/tooldocs/solaris/keytool.html

...dviji
0
 
kmurphy7Author Commented:
When I try to run it with appletviewer I get access denied. I have a .keystore file. It is in my c:\windows directory. I have a .java.policy file. It is in my c:\windows directory. I have a JAVAEXE.class, signedJAVAEXE.jar, ExeApplet.class, and a ExeApplet.html all in a folder. Are any of these files in the wrong place? Do I need to import anything to get to the signed jar file?
0
 
omry_yCommented:
post another question.
0

Featured Post

How to Use the Help Bell

Need to boost the visibility of your question for solutions? Use the Experts Exchange Help Bell to confirm priority levels and contact subject-matter experts for question attention.  Check out this how-to article for more information.

  • 2
  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now