Skip to Main Content

Java Programming

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Opening a web page in an applet.

807589Jan 2 2009 — edited Jan 2 2009
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.
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jan 30 2009
Added on Jan 2 2009
10 comments
64 views