Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
I created a virus or what ? [ LOL ]
#9
(03-24-2012, 02:49 AM)aHardyX Wrote: Haha. Its not a virus. Its a glitch in your programming.
Firstly, the saving mechanism you stated above will obviously replace the text in the file. You need to open the file in your program and then make changes to it. Whenever you stream out data into a file through java, it will replace the whole file. But if you still want that method then do the following changes in your program.

On clicking the "save" button on the Save dialog, use FileReader to read the existing lines in the text file. Store those into a string array. Then rewrite them into the file using FileWriter. Then take the text from the TextArea and write them into the using FileWriter again.

That's it. If you still have problems with it just reply here. And do note that I get a NullPointerException at function loadFile(). Check that out too.

Best of luck with the coding. Smile

And I just realized that this topic was bumped *sigh*

Its hard for me to know, posts on the first page can be months old Confused
Reply


Messages In This Thread
I created a virus or what ? [ LOL ] - by prince76 - 02-03-2012, 02:44 PM
RE: I created a virus or what ? [ LOL ] - by Grin - 03-22-2012, 01:59 PM
RE: I created a virus or what ? [ LOL ] - by redpois0n - 03-24-2012, 07:16 AM

Forum Jump:


Users browsing this thread: 1 Guest(s)