Java Applet Interview Questions and Answers
The Best LIVE Mock Interview - You should go through before Interview
Intermediate / 1 to 5 years experienced level questions & answers
Ques 1. How do I select a URL from my Applet and send the browser to that page?
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?
Add Comment
View Comments
Most helpful rated by users:
- What is an applet?
- What is the difference between an Applet and an Application?
- How will you establish the connection between the servlet and an applet?
- What is an Applet? Should applets have constructors?
- How will you initialize an Applet?