JTextPane - syntax highlighting

  • Follow


I need to perform Syntax highlighting for java in a JTextPane but i
can't find any tutorials which show how to do it. What exactly are the
steps needed to do this and how do i use editor kits.

0
Reply nsm.nikhil (4) 3/24/2005 1:58:40 PM

nsm.nikhil@gmail.com wrote in message news:<1111672720.858155.229330@z14g2000cwz.googlegroups.com>...
> I need to perform Syntax highlighting for java in a JTextPane but i
> can't find any tutorials which show how to do it. What exactly are the
> steps needed to do this and how do i use editor kits.
JTextPane styling, including text color, is done via
MutableAttributeSet and setXxxxAttributes() method.
0
Reply HGA03630 3/25/2005 2:19:51 AM


Here is a good example which might help:

http://www.discoverteenergy.com/files/SyntaxDocument.java

If you have jEdit you can also look at its source to try and understand
how it is done. You can even use their package. There is no point in
reinventing the wheel.

--
Fahd Shariff
http://www.fahdshariff.cjb.net
"Let the code do the talking... "

0
Reply Fahd 3/25/2005 6:07:26 PM

2 Replies
564 Views

(page loaded in 0.055 seconds)

Similiar Articles:











7/23/2012 11:51:46 AM


Reply: