So I am trying to make this swing GUI that searches a list of books and then displays the book in a JTextArea. Here is my actionPerformed Method

```
public void actionPerformed(ActionEvent e) {
    if (e.getActionCommand().equals("Search Books")){
        String bookName = JOptionPane.showInputDialog(this, "Enter books to search"); // prompts user to enter book title
        if (bookName == null){
            sArea.append("Enter a Book");
        }else{
            for (Book b: ban.getListOfBooks()){ //going through list of books to find matching title
                if (bookName.equals(b.getTitle())){ // appends string if it is equal to one of the book names
                    sArea.append(bookName);
                }else{ 
                    sArea.append("Book not found");
                }
            }
        }
    }else{
        ...

```

So my problem is for the for each loop. Naturally it will print "Book not found" for every element in the list that is not equal. So if i have ten books, and i enter the name of the first one, it will print that and then "Book not found" nine times. How could i reformat this to only print out one thing?