Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / GUI / February 2004

Tip: Looking for answers? Try searching our database.

JEditorPane, HTMLDocument, & Custom Tags

Thread view: 
SD - 04 Feb 2004 20:17 GMT
Hello,

 I've figured out how to make my custom tag reconginze itself from the
HTML and do a custom view for it.  Now I'd like to make it such that in
an editable JEditorPane, the user cannot delete this particular tag.  I
have no idea how to do this.

 One way would be to detect the removal and undo the remove (but that
is REALLY hookey).
 
 Does anyone have any ideas on this one?

Thanx SD.
SD - 04 Feb 2004 21:14 GMT
I figured it out: override the method:
   javax.swing.text.html.HTMLDocument.remove(int offs, int len)

and use getCharacterElement(offs) to get the tag being removed and don't
call the super classes remove if you don't want the tag removed.

SD.


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.