Skip to content Skip to sidebar Skip to footer

How To Get Current Html Element(tag) In Jtextpane?

I am doing on WYSIWYG Html Editor using Java Program. I need When I click mouse on Paragraph element, It should be displays tag in JOption dialog. Please advice me How can i do th

Solution 1:

See for example this one http://java-sl.com/JEditorPaneStructureTool.html

In simple words you can get your HTMLDocument and get paragraph using getParagraphElement() method. Use viewToModel() method of JEditorPane to get caret offet for the clicked point.

Post a Comment for "How To Get Current Html Element(tag) In Jtextpane?"