I need to open a web page in an applet, but I can't find how to do it.
This is the code I have in the
paint method.
appContext = getAppletContext();
try
{
url = new URL("google.com");
} catch (Exception e)
{
System.out.println("Didn't work.");
url = null;
}
try
{
if(url != null)
appContext.showDocument(url, "_self");
} catch (Exception e)
{
System.out.println("Error loading page.");
}
The
showDocument is what isn't working I'm pretty sure because I don't get an error, the applet starts, and the web page doesn't load.
Please help.