Reputation: 95
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 this?
Upvotes: 1
Views: 1243
Reputation: 57381
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.
Upvotes: 5