java - Getting text without HTML tags from JTextPane -


i have created text editor using jtextpane allows user make style changes text (bold, color. underline, etc.) text , applied style settings stored in html. text pane set format text on end html. here's of basic set text pane:

htmleditorkit editorkit = new htmleditorkit(); this.seteditorkit(editorkit); this.setdocument(editorkit.createdefaultdocument()); this.setcontenttype("text/html"); 

my question how can text text pane without html attached it. want able text user sees. need able determine character length of text inside pane. when call gettext on pane, give me text including html. there way retrieve text user sees without html? thanks! :)

this.getdocument().gettext(0,this.getdocument().getlength()) 

document has plain text , html formatting document's structure , attributes applied same text.


Comments

Popular posts from this blog

commonjs - How to write a typescript definition file for a node module that exports a function? -

openid - Okta: Failed to get authorization code through API call -

thorough guide for profiling racket code -