This is a Real-Time Text Autocomplete application built using Java Swing. It provides real-time word suggestions based on user input. The program uses a Trie (prefix tree) for efficient storage and retrieval of words.
- Real-Time Suggestions:
- Displays relevant suggestions as the user types in the text field.
- Preloaded Dictionary:
- Includes a set of predefined words for testing the autocomplete functionality.
- Case-Insensitive Search:
- Suggestions are provided regardless of the case of input.
- Clean GUI:
- Simple and responsive graphical interface using Swing.
- Trie (Prefix Tree):
- A tree-based data structure used for fast prefix-based searches.
insert(String word):- Inserts a word into the Trie.
getWordsStartingWith(String prefix):- Retrieves all words in the Trie that start with a given prefix.
collectAllWords(TrieNode node, StringBuilder prefix, List<String> results):- Recursively collects all words from a given Trie node.
- Run the Program:
- Execute the
TextAutocompleteclass.
- Execute the
- Enter Input:
- Start typing in the text field at the top of the application.
- View Suggestions:
- Relevant word suggestions appear dynamically in the list below.
- Select a Suggestion (Optional):
- Suggestions are for display only, but the program can be extended to allow selection.
The dictionary includes the following words:
apple,application,appreciatebanana,basketcat,dog,dolphinelephant,fish,grapejava,javascriptorange,pear,zebra
appleapplicationappreciate
javajavascript
- (No suggestions)


