• Post Reply Bookmark Topic Watch Topic
  • New Topic

save text file problem help !

 
Pepo moussa
Ranch Hand
Posts: 36
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hello i been having this problem for long time now and i just can not find what is the problem in my code ..what i am trying to do is to read text file get the correct data and save it in linked list then save it again with different name as a text file . now the problem is i can read the file fine but when i try to save it, it save empty list also if i tried to delete anything form the list it says that this item is not there . any one can help

here is my code
file opener




GUI

[ May 21, 2008: Message edited by: Pepo moussa ]
 
Campbell Ritchie
Marshal
Posts: 52602
119
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Have you put in any debugging? For example, some println() statements which print out what you have read? Then println() statements in the actionPerformed() method?

Why are you using addAnythingListener(this)? See this thread.
Why are you using == with objects? That won't work, will it?
 
Pepo moussa
Ranch Hand
Posts: 36
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i did fix the problem for the saver and read file but still having one small problem ,when i try to open a file it works fine when i try to open different file it adds the data to the old list that i already opened any idea what can cause this problem now ? also i edit my code in the first post so the code in the first post is the correct one
 
Campbell Ritchie
Marshal
Posts: 52602
119
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well done getting this far.
It might have been better to post a separate listing of the new code; other beginners reading it would have learned by seeing the differences.

Don't know exactly what is going on, but check how you are creating and closing writer objects.
 
Paper has not yet been outlawed – so let your Java Swing application print with wild abandon: JPDF
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!