Prepare Interview

Mock Exams

Make Homepage

Bookmark this page

Subscribe Email Address

Java%20Applet%20Interview%20Questions%20and%20Answers

Question: How do I select a URL from my Applet and send the browser to that page?
Answer:

Ask the applet for its applet context and invoke showDocument() on that context object.

URL targetURL;
String URLString;
AppletContext context = getAppletContext();
try
{
    targetURL = new URL(URLString);
}
catch (MalformedURLException e)
{
    // Code for recover from the exception
}
context. showDocument (targetURL);

Is it helpful? Yes No

Most helpful rated by users:

©2024 WithoutBook