• Post Reply Bookmark Topic Watch Topic
  • New Topic

How to find if Match is not found  RSS feed

 
Anthony Johnson
Ranch Hand
Posts: 45
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm trying to make my code clear out the model's list if no match is found. Can anyone help me with this.



 
Campbell Ritchie
Marshal
Posts: 56562
172
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please explain what you are trying to do.
Don't write equals("") write isEmpty() instead. I would have thought the isEmpty() test shou‍ld precede the loop as the if part of an if‑else.
What does the bit about − 1 mean in line 11? Why are you going for sheet 1? Is that the only sheet? How are you going to go from match.find() to locating what has been found? Why are you using a loop rather than an if statement?
Why are you using a key listener? What is wrong with a high‑level listener? You can add action listeners to text fields (I think).
Why does your tools object have non‑private fields?
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!