Solved

App

Posted on 2001-08-10
6
227 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
Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
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

Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

Question has a verified solution.

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

Suggested Solutions

Are you developing a Java application and want to create Excel Spreadsheets? You have come to the right place, this article will describe how you can create Excel Spreadsheets from a Java Application. For the purposes of this article, I will be u…
In this post we will learn how to connect and configure Android Device (Smartphone etc.) with Android Studio. After that we will run a simple Hello World Program.
Viewers will learn about the different types of variables in Java and how to declare them. Decide the type of variable desired: Put the keyword corresponding to the type of variable in front of the variable name: Use the equal sign to assign a v…
Viewers will learn one way to get user input in Java. Introduce the Scanner object: Declare the variable that stores the user input: An example prompting the user for input: Methods you need to invoke in order to properly get  user input:

828 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