Non-Open Source developers rejoice,
The jEdit 2.2.1 (very old, but still better than the syntax
highlighting in commercial Java IDEs) syntax highlighting and
text area packages are now available under a very liberal license
which allows them to be linked into commercial software, etc.
Download this from <ftp://jedit.sourceforge.net/pub/jedit/jEdit-221-syntax.zip>.
Note that this code is old and no longer maintained, so I'm not
going to do any debugging. If it breaks, keep both pieces.