Hey guys,
I want to get the HTML text file from a URL so that I can modify it before displaying it in a JTextPane, but I can’t find any way to simply get the text out! Any help?
Hey guys,
I want to get the HTML text file from a URL so that I can modify it before displaying it in a JTextPane, but I can’t find any way to simply get the text out! Any help?
Have you looked at package javax.swing.text.html.
create a new URL object that points to the website you want. then read through it’s InputStream (which you can get via the URL’s openStream() method) until it returns null. viola, HTML (or whatever the server outputs).
Ooh yays. I was trying a URLConnection stream instead, which is where I went wrong I guess. I’ll try this out.
Yup, works great. Thanks guys!