Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

InputStream from JEditorPane  RSS feed

 
Murad Iqbal
Ranch Hand
Posts: 90
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all!

Does anyone know if and how can we obtain an InputStream object from a JEditorPane. I have loaded an HTML page in my JEditorPanel through a URL, have done some editing to its html and then its contents have to be passed through InputStream to JTidy... So anyway I can get the InputStream object?

Regards.
 
Joe Ess
Bartender
Posts: 9406
12
Linux Mac OS X Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm not sure if it is the most direct way, but you can get the Document instance from the JEditorPane. Then get the content of the Document as a String with getText() and you can read a String with a StringReader. Hopefully JTidy accepts a Reader as well as an InputStream.
 
Don't get me started about those stupid light bulbs.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!