public int colouringWord(StyledDocument doc, int pos)
				throws BadLocationException {
			int wordEnd = indexOfWordEnd(doc, pos);
			String word = doc.getText(pos, wordEnd - pos);

			if (keywords.contains(word)) {
				// ǹؼ, ͽйؼֵɫ, ʹͨɫ.
				// һҪע, insertUpdateremoveUpdateķõĹ, ޸doc.
				// Ҫﵽܹ޸doc, ԰Ѵŵȥִ.
				// ʵһĿ, ʹ߳, ŵswing¼ȥһ.
				SwingUtilities.invokeLater(new ColouringTask(doc, pos, wordEnd
						- pos, keywordStyle));
			} else {
				SwingUtilities.invokeLater(new ColouringTask(doc, pos, wordEnd
						- pos, normalStyle));
			}

			return wordEnd;
		}