Restricting HTML tags entered in a JEditorPane

R

Rex King

I have to create a HTML pane using a JEditorpane that lets the user
type in HTML formatted text and then preview it.
However-the user is only allowed to enter a few tags-bold, underline,
italics, and ordered and unordered lists.
The conventional way to do it would be to parse the entered string and
filter out the other tags.
Is there a better way to do it, using the editorkit classes, or the
HTMLDocument class, or something like that?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,001
Messages
2,570,255
Members
46,853
Latest member
GeorgiaSta

Latest Threads

Top