facebook

urgent>>how to create empty file in eclips

💡
Our Forums Have Moved

For help with installation, bugs reports or feature requests, please head over to our new forums.
Genuitec Community on GitHub

  1. MyEclipse IDE
  2.  > 
  3. Off Topic
Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #247000 Reply

    uaeustudent
    Member

    i m new with eclips and i want to know how i can

    Write a java applet ((theapplet.java)) that does the following.
    Creates an empty file on the client side. The name of the file is given
    by the client user.
    Reads a file (example: c:\tmp\toto.txt) from the client side. The name
    of the file is given by the client user. If the file does not exist, the
    applet should display a message error “File does not exist”.

    i hope that some one can help
    😳 😳 student

    #247005

    Haris Peco
    Member

    uaeustudent ,

    You can’t do it.Java applet can’t write/read local file system because security reason (applet’s user can break this restriction, but it isnt recommended)

    best

    #247007

    uaeustudent
    Member

    support-snpe

    what about creating emplty file.. i dont know the codes to do it

    thanx for reply
    student

    #247021

    Riyad Kalla
    Member

    Snpe is correct, you *cannot* do this from an applet. But if you still want the code to create a file, I *think*:

    
    File myFile = new File("C:\\test.txt");
    myFile.createNewFile();
    

    should do the trick.

    #247076

    uaeustudent
    Member

    thanx for reply

    what i really want is to create an applet (the applet)by eclips that has text area(text1) with two Jbutton (create and read)…>>the interface

    😳
    regards,
    student

    #247105

    Haris Peco
    Member
Viewing 6 posts - 1 through 6 (of 6 total)
Reply To: urgent>>how to create empty file in eclips

You must be logged in to post in the forum log in