Applet that writes a .txt file


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 3 of 3

Thread: Applet that writes a .txt file

  1. #1
    Kon P Guest

    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

  2. #2
    Ruchi Dhar Guest

    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



  3. #3
    Ako Guest

    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
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center