• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Another issue in a GUI

 
Marcelo Bordolli
Ranch Hand
Posts: 46
Android Java Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i have GUI whit a jtextfield that search for a match in text file that i got saved somewere. but the thing is that i just realize that search like this

this is my text file and ive marked what is seen by my search and what is not:
Alfredo Garcia 34353454 (Not seen)
Richard Blemen 23525342 (seen)
Mick Jagger 24523523 (Not seen)
Robert Pattinson 65434518 (seen)
Hayden Pannetiere 36486712 (not seen)
Alice Eve 97246590 (seen)
Hugo Beaven 28288282 and it keeps like this trough the hole file ,seen one and the next not seeing it
Beavis Acdc 54545445
Buthead Acdc 12121221
Mathias Oviedo 78787887
Marcos Viera 29292992
Wesker Almond 33333333
Trinity Gogo 22222222
Tia Carrera 44444444
Kristen Stweart 66666666
Charlize Theron 77777777
Denzel Washington 99999999
Angus Young 23312323
Malcom Young 23311332
Jhon Lennon 57575775
Jason Statam 83838383
Mario Bros 91291291
Luigi Bros 48297538
Amy Adams 98239832
Isla Fisher 20202020

this is my code wen i press search button:

 
Kemal Sokolovic
Bartender
Posts: 825
5
Java Python Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What do you mean by "seen" and "not seen"? Those lines are never read at all? Did you try to run it through debugger and check you Tex variable in each iteration to be sure about that?

EDIT: Wow, my bad! You are invoking readLine twice in each iteration, that's why you get only every 2nd line. You should assign to Tex in your while loop, something we've already done yesterday in your code:
 
Marcelo Bordolli
Ranch Hand
Posts: 46
Android Java Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ok Kemal now i fix that problem whit your hint.
But now i know what was the thing whit the 0s.in my text file wen i search it search for everything now the to the above, but wen i try to modify, it works perfectly to the lines the the code above use to show , but wen i try to modify the new names that now i can see thanks to the code above it change it but it also add the 0s and some time 3s or 7s many many of them. the issue must be in the search action button or in the modify action button. ill put both of them here:

 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic