• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Links in Applet

 
Abi rami
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Stephanie Grasson
Ranch Hand
Posts: 347
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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;
}
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic