I’ve basically made a simple text editor with a JTextPane and some styling options (bold, italicize, underline, and center/right/left justify options), and I’m wondering if there is any easy way to view the HTML version?
What I’m eventually wanting to do is have an “export as HTML” type option that just has the plain text, but it’s formatted with HTML tags instead of being styled.
Thanks
If you want HTML, then you need to make sure the content type is
text/htmlso the proper editor kit is used.Then you use
textPane.getText()to get the HTML.