20 likes | 145 Views
Lab. Write a SpellChecker application. User will input some text into a TextBox. When he choose “Spell”, words not in dictionary file will be alerted. Instruction: Dictionary will be stored in text file, words are seperated by spaces. Check by String.indexOf(). Read text file into String.
E N D
Lab • Write a SpellChecker application. User will input some text into a TextBox. When he choose “Spell”, words not in dictionary file will be alerted.Instruction: • Dictionary will be stored in text file, words are seperated by spaces. • Check by String.indexOf()
Read text file into String InputStream is = this.getClass().getResourceAsStream(“/dic.dat"); String message = ""; int ch; while (-1 != (ch = is.read())) { message = message + (char)ch; }