Java Applet Programming Question: Download Java Applet PDF

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

Tweet Share WhatsApp

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);

Download Java Applet PDF Read All 26 Java Applet Questions
Previous QuestionNext Question
How can I arrange for different applets on a web page to communicate with each other?Can applets on different pages communicate with each other?