Viewing nonprinting symbols in JTextPane


Let me please, can I view nonprintig symbols in JTextPane (such as space, paragraph, tab) similar to MSWord
And how I can make this feature.
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

getText() on the text control, do a find/replace on it and then setText()
You could also create a subclass of JTextPane that would automatically swap the characters when text was added.

I believe the question is not how to get rid of special characters, but how to show them.
1. You should overwrite the default views for displaying the text (PlainView, LabelView, WrapedPlainView, etc) to allow this.
2. The other suggestion is to implement your own view to handle thevisual drawing of those chars, create special Elements to hold the characters and overwrite the default view factory implemented by the EditorKit, and serve your implementation when appropiate.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Cloud Class® Course: MCSA MCSE Windows Server 2012

This course teaches how to install and configure Windows Server 2012 R2.  It is the first step on your path to becoming a Microsoft Certified Solutions Expert (MCSE).

ovi's way is better, although that should be 'override' not 'overwrite' ;-)
:) excuse please a non english speacker&writer ...
That's OK - English speakers do it too ;-)
This old question needs to be finalized -- accept an answer, split points, or get a refund.  For information on your options, please click here-> http:/help/closing.jsp#1 
Post your closing recommendations!  No comment means you don't care.
Another suggestion: perform a getText() into a StringBuffer and consequently decide for yourself what and how you would like to display it (for instance <007> as \007 (4 characters) or as [BELL] ...)
use StringBuffer.replace()
Finally perform a setText() and it should show as you wanted it.
This way you don't have to write your own view processing: everything remains standard.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.