Solved

App

Posted on 2001-08-10
6
225 Views
Last Modified: 2012-08-13
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
Comment
Question by:kmurphy7
  • 2
  • 2
  • 2
6 Comments
 
LVL 1

Expert Comment

by:dviji
ID: 6373190
   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
 

Author Comment

by:kmurphy7
ID: 6373277
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
 
LVL 4

Expert Comment

by:omry_y
ID: 6376124
it will not work.
to run native programs, your applet must be signed.
0
ScreenConnect 6.0 Free Trial

Explore all the enhancements in one game-changing release, ScreenConnect 6.0, based on partner feedback. New features include a redesigned UI, app configurations and chat acknowledgement to improve customer engagement!

 
LVL 1

Accepted Solution

by:
dviji earned 100 total points
ID: 6376157
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
 

Author Comment

by:kmurphy7
ID: 6385883
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
 
LVL 4

Expert Comment

by:omry_y
ID: 6386005
post another question.
0

Featured Post

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Python Assistance 7 80
Java JRE greater than 1.6 5 62
table example 4 29
Unhandled exception type Exception 18 31
Introduction Java can be integrated with native programs using an interface called JNI(Java Native Interface). Native programs are programs which can directly run on the processor. JNI is simply a naming and calling convention so that the JVM (Java…
Java functions are among the best things for programmers to work with as Java sites can be very easy to read and prepare. Java especially simplifies many processes in the coding industry as it helps integrate many forms of technology and different d…
Viewers will learn about the regular for loop in Java and how to use it. Definition: Break the for loop down into 3 parts: Syntax when using for loops: Example using a for loop:
The viewer will learn how to implement Singleton Design Pattern in Java.

773 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question