Java #11 - Writing a Text File

Loading...

Sign in or sign up now!
Alert icon
Upgrade to the latest Flash Player for improved playback performance. Upgrade now or more info.
11,301
Loading...
Alert icon
Sign in or sign up now!
Alert icon
There is no Interactive Transcript.

Uploaded by on Jun 5, 2009

Shows how to write a text file using a PrintStream object. Also demonstrates JFileChooser file save dialogs with a FileNameExtensionFilter. Download source code from http://java.martincarlisle.com

Category:

Education

Tags:

License:

Standard YouTube License

  • likes, 4 dislikes

Link to this comment:

Share to:

Uploader Comments (carlislemc)

  • is there a way to delete a 'string' from a text file?

  • Not directly. You'd need to read in the file and then write it out again without the String you are trying to delete.

see all

All Comments (7)

Sign In or Sign Up now to post a comment!
  • @carlislemc Nevermind, i got it fixed, was such a stupid question too :P

  • @Djentard I am sorry, but I do not understand your question.

  • Thanks for your tutorials.

    I do however have a question and maybe this WriteSimpleFile could be expanded;

    1) It does not get same directory as the .java file

    2) Type a name for file, however no extension is added if I don't type full filename

    3) Add multiple file Filters, ie. Java or TXT being shown, if so then save with that extension

    Just a couple ideas as I'm new to Java, thanks again

  • Thanks for the source code to this example. Just what I was looking for.

Loading...
Alert icon
0 / 00Unsaved Playlist Return to active list
    1. Your queue is empty. Add videos to your queue using this button:
      or sign in to load a different list.
    Loading...Loading...Saving...
    • Clear all videos from this list
    • Learn more