Solved

Applet and application

Posted on 2004-04-05
6
157 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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:Mayank S
Mayank S 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:Mayank S
ID: 10958056
Please proceed with that recommendation.
0

Featured Post

PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

Question has a verified solution.

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

After being asked a question last year, I went into one of my moods where I did some research and code just for the fun and learning of it all.  Subsequently, from this journey, I put together this article on "Range Searching Using Visual Basic.NET …
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 learn about the “while” loop and how to utilize it correctly in Java. Additionally, viewers begin exploring how to include conditional statements within a while loop and avoid an endless loop. Define While Loop: Basic Example: Explanatio…
Viewers learn about the scanner class in this video and are introduced to receiving user input for their programs. Additionally, objects, conditional statements, and loops are used to help reinforce the concepts. Introduce Scanner class: Importing…

627 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