Skip to Main Content

Java Programming

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

delete a line in textfile?

807607Dec 20 2006 — edited Dec 20 2006
hello,

how can I delete a specified line in a textfile.
The text file created by file.write() method in a folder(ex. D:/xy.txt).

My program problem is, hen I click on item in JList, the selected item deleted from the text file where I previously stored the values.

like,

xy.txt
-------------
hello, It a funny thing. ---> line 1
dsfdsfsdfdfgggg ---> line 2


I want to delete line 1 from the text file.

how can i do it.
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jan 17 2007
Added on Dec 20 2006
1 comment
218 views