Solved

Applet and application

Posted on 2004-04-05
6
150 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: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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
JAVA part two 5 58
Java Timer (static) 9 36
MySqlDump not dumping triggers 1 19
configure dependency in POM for new database 3 18
For beginner Java programmers or at least those new to the Eclipse IDE, the following tutorial will show some (four) ways in which you can import your Java projects to your Eclipse workbench. Introduction While learning Java can be done with…
Java contains several comparison operators (e.g., <, <=, >, >=, ==, !=) that allow you to compare primitive values. However, these operators cannot be used to compare the contents of objects. Interface Comparable is used to allow objects of a cl…
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:
This tutorial will introduce the viewer to VisualVM for the Java platform application. This video explains an example program and covers the Overview, Monitor, and Heap Dump tabs.

863 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

18 Experts available now in Live!

Get 1:1 Help Now