I have the following code in my swing application:
URL url = new URL("http://stackoverflow.com/");
InputStream is = url.openStream();
But downloading the webpage by using the openStream method makes the swing application hang until the webpage is fully downloaded. How do I prevent this/what are the alternatives, so I can show a loading image until the webpage is fully downloaded?
Load in a separate thread: