There's a lot of issues here, and your question is very vague - you could be asking any of the following questions:
How do I make a search box?
You're asking how to properly implement a search box in AWT. First off, use Swing, it's a lot nicer. From there, resources like How to use Text Fields will be very helpful.
How do I make a search application?
You're asking how to implement searching behavior in a GUI. In this case, the key concept you need to understand is Model View Controller, which will let you compartmentalize your business logic from your graphical interface in a clean and efficient way.
How do I efficiently search data?
You're asking for data structures that are good for searching. The classic answer is a Binary Search Tree or a binary search algorithm, like
Collections.binarySearch()
, which allows you to search inO(log n)
time. This may or may not be enough for your use case, but another possible option is a Trie, which provides fast prefix-searching. If these basic data structures aren't good enough for your use case, read on.How do I store data for efficient searches?
Very much dependent on exactly what you're trying to do, but the concept is called Serialization. Java provides serialization behavior natively, however I personally vastly prefer using JSON, and Google's awesome Gson library makes this quite painless.
What tools exist to provide search behavior for me?
If answer #3 wasn't good enough, you're looking for something more powerful. You've got two basic choices, depending on your needs. Either a Relational Database, or a Search/Index library. There are countless database options out there, but I like H2 for quick Java work. A proper search tool like Lucene is almost certainly overkill for your needs, but the option exists.
I hope some of this answers your question. In the future, try to create questions that can have a concrete answer. Questions that are open-ended and leave the notion of "answered" undefined are very difficult to properly address.