Forums Register Login

Links in Applet

+Pie Number of slices to send: Send
Would any one please let me know how to add links in the applet. I have a ticker applet and if anyone clicks on a particular string, a Html page should be loaded. Thanks in advance.
Sud
+Pie Number of slices to send: Send
Sud,
Try adding this method to your applet:
// allows us to jump to other web pages
private boolean linkTo(String theURLString)
{
try
{
URL theURL = new URL(theURLString);
getAppletContext().showDocument(theURL, "_top");
}
catch(MalformedURLException e)
{
// alert the user or handle it yourself
return false;
}
return true;
}
Evil is afoot. But this tiny ad is just an ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com


reply
reply
This thread has been viewed 695 times.
Similar Threads
Please help : applet throwing security exception.........
Applet not loading
JSP->Applet communication
How Applets create and write text files in server?
Clock
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 28, 2024 11:36:33.