Solved

Applet and application

Posted on 2004-04-05
6
149 Views
Last Modified: 2013-11-23
hi
I want to take file from hard disk through browse option using applet and the mentioned file should be read using Fileinput stream and copied to another file using File outputstream.how it can be done?
TIA
0
Comment
Question by:kousis
  • 2
6 Comments
 
LVL 16

Accepted Solution

by:
warturtle earned 75 total points
ID: 10759224
Hi,

Applets are not the best way to write to files, because they have security restrictions on a system. The Java Virtual Machine(JVM) has got a 'sandbox' model for Applets, they can't access any system resources, like writing files, etc.

Better way to do this task is to use Java Swing in a Java Application. Use the Java Swing Tutorial on Sun's website at http://java.sun.com

Regards,

Warturtle
0
 

Author Comment

by:kousis
ID: 10759531
I just wanted to get the file name through applet. I wanted my program to be user friendly.
0
 
LVL 30

Assisted Solution

by:mayankeagle
mayankeagle earned 75 total points
ID: 10763025
You can have a user-friendly interface through Swing/ AWT as well. But if you're not willing to do it by anything other than an Applet, then your Applet needs to be signed in order to access files, etc, otherwise I guess that it will throw a SecurityException.

Have a look at: http://www.mindprod.com/jgloss/signedapplets.html

http://personal.vsnl.com/sureshms/javasign1.html (courtesy objects)
0
 
LVL 30

Expert Comment

by:mayankeagle
ID: 10958056
Please proceed with that recommendation.
0

Featured Post

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

Suggested Solutions

INTRODUCTION Working with files is a moderately common task in Java.  For most projects hard coding the file names, using parameters in configuration files, or using command-line arguments is sufficient.   However, when your application has vi…
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…
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 about if statements in Java and their use The if statement: The condition required to create an if statement: Variations of if statements: An example using if statements:

762 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

24 Experts available now in Live!

Get 1:1 Help Now