Solved

App

Posted on 2001-08-10
6
219 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
Comment Utility
   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
Comment Utility
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
Comment Utility
it will not work.
to run native programs, your applet must be signed.
0
What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

 
LVL 1

Accepted Solution

by:
dviji earned 100 total points
Comment Utility
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
Comment Utility
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
Comment Utility
post another question.
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
matchUp  challenge 9 71
countPairs challenge 7 57
parentbit challenge 3 51
What is the latest versions eclipse neon 2 116
Introduction This article is the first of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article explains our test automation goals. Then rationale is given for the tools we use to a…
Introduction This article is the last of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers our test design approach and then goes through a simple test case example, how …
Viewers learn about the “for” loop and how it works in Java. By comparing it to the while loop learned before, viewers can make the transition easily. You will learn about the formatting of the for loop as we write a program that prints even numbers…
Viewers will learn about arithmetic and Boolean expressions in Java and the logical operators used to create Boolean expressions. We will cover the symbols used for arithmetic expressions and define each logical operator and how to use them in Boole…

744 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

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now