I’m using a JTextPane to load up HTML in my game and, um, I have to say it’s really bothering me at this point.
I have a few issues with it…
- It loads very slowly, and, as far as the user can see, loads it instantly so it looks like the computer has hung for longer pages.
- After loading a page, the scrollbar is sent to the bottom. I’ve tried sending it to the top after loading, but in reality it does not load instantly. It must start another thread or something to load the page, but I’m unsure how it does it.
- I’ve been looking through the JDK and trying a million different ways, but as far as I can tell there is absolutely no possible method to see how much a page is loaded. If there was, I could manually move the scrollbar up after it’s loaded, set it to display “loading” until it has fully loaded, etc.
Does anyone know of any way to do this? I’m strongly debating making my own HTML loader, because, honestly, JTextPane is pretty worthless. The actual HTML text loads in as far as I can tell an instant, but even though I parse out all images and frames before loading, the JTextPane can sometimes take 15 seconds of apparent hang time to display. Aggravating.
So does anyone know of a good replacement HTML loader or how to get the percentage loaded?
Thanks.