-
Applet that writes a .txt file
Hello!
I am a java neophyte and I in big trouble lately. I want to make a simple
applet with two textfields (name & email) and two buttons (Submit & Clear).
It's very simple up to here. The problem is that I want the information from
these two textfields, stored in a .txt file. I've tried it over and over
without a result. I would be really grateful if someone could tell me how
to do it or even better send me some code here or by e-mail.
Than you very much!
Kon
-
Re: Applet that writes a .txt file
If you read what is an applet properly you might read about the restrictions
of applets. Applets can't access any local resources(like write/reading
from files, opening socket connections etc). If you want to read/write local
disk files you need to write signed applets. Read Java doc for writing signed
applets. Signed applets are a mess (Its all depend on browser).
"Kon P" <pknj25@hotmail.com> wrote:
>
>Hello!
>I am a java neophyte and I in big trouble lately. I want to make a simple
>applet with two textfields (name & email) and two buttons (Submit & Clear).
>It's very simple up to here. The problem is that I want the information
from
>these two textfields, stored in a .txt file. I've tried it over and over
>without a result. I would be really grateful if someone could tell me how
>to do it or even better send me some code here or by e-mail.
>
>Than you very much!
>Kon
-
Re: Applet that writes a .txt file
It might seem harmless to you at this stage if we were able to have an applet
writing to a file, but that is not how java sees things. Applets are meant
to run in a browser on the client's machine and for security reasons it makes
sense not to allow writing or reading anything to and from the host environment.
If an applet is able to do that,it would be what is called a "hostile applet".
if your application needs to get the client's name and E-mail address, then
you could either use HTML forms or better if you use a servlet. This way
you can get the parameters that you require from the client and then do whatever
you want with them on your machine.
Good luck with java.
Ako
"Kon P" <pknj25@hotmail.com> wrote:
>
>Hello!
>I am a java neophyte and I in big trouble lately. I want to make a simple
>applet with two textfields (name & email) and two buttons (Submit & Clear).
>It's very simple up to here. The problem is that I want the information
from
>these two textfields, stored in a .txt file. I've tried it over and over
>without a result. I would be really grateful if someone could tell me how
>to do it or even better send me some code here or by e-mail.
>
>Than you very much!
>Kon
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
Forum Rules
|
Top DevX Stories
Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL
|
Bookmarks