I'm building a simple java editor and would like to add a functionality such
as following:

I would like my editor to recognize keywords such as "class", "if",
"switch", "case", "return", etc... Upon recognition, I want the editor to
make those keywords bold face. If I it is possible, I would like the editor to
perform the above action on opening any saved *.java files and also as I type them.
Something similar to VB code editor. Does any one have source code or idea on how to do this ?
Many thanks in advance.