This week's book giveaway is in the OCPJP forum.
We're giving away four copies of OCA/OCP Java SE 7 Programmer I & II Study Guide and have Kathy Sierra & Bert Bates on-line!
See this thread for details.
The moose likes Swing / AWT / SWT and the fly likes custom tags using an HTMLEditorKit subclass Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCA/OCP Java SE 7 Programmer I & II Study Guide this week in the OCPJP forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "custom tags using an HTMLEditorKit subclass" Watch "custom tags using an HTMLEditorKit subclass" New topic
Author

custom tags using an HTMLEditorKit subclass

Scott Presley
Greenhorn

Joined: Apr 15, 2003
Posts: 25
I've created a subclass of HTMLEditorKit called CustomEditorKit(see code below) At the point in the code marked with the 'UGH' comment, I want to check to see if the unknown element is of type <expression>x+4</expression> and create return a Custom View object containing the 'x+4' inside the tags... I figured out how to check to see that the element is indeed 'expression', but it's unclear from reading online and reading through javadoc how to extract the 'x+4'.

Thanks in advance for any help,
Scott


[ July 13, 2004: Message edited by: Scott Presley ]
Stanislav Lapitsky
Ranch Hand

Joined: Dec 01, 2009
Posts: 53
I have an example of the feature.

See
http://java-sl.com/custom_tag_html_kit.html

It's implemented to support <button> tag but can be easy extended.

Regards,
Stas
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: custom tags using an HTMLEditorKit subclass