aspose file tools*
The moose likes Applets and the fly likes Hyperlinks Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Applets
Bookmark "Hyperlinks" Watch "Hyperlinks" New topic
Author

Hyperlinks

P. Sagdeo
Ranch Hand

Joined: Nov 13, 2003
Posts: 67
Anyone know how to create hyperlinks in Applets/JApplets? (Someone clicks at X,Y and is redirected to another page). I know it can be done! Thanks
Ernest Friedman-Hill
author and iconoclast
Marshal

Joined: Jul 08, 2003
Posts: 24183
    
  34

Well, you use the showDocument() methods in AppletContext (you say getAppletContext().showDocument(URL, "frame") to show the URL in a frame named "frame".) As far as clicking at X, Y, that's just a matter of handling the mouse events.


[Jess in Action][AskingGoodQuestions]
P. Sagdeo
Ranch Hand

Joined: Nov 13, 2003
Posts: 67
Thanks, but I meant open a browser and go to a website, not inside the applet.
Ernest Friedman-Hill
author and iconoclast
Marshal

Joined: Jul 08, 2003
Posts: 24183
    
  34

Not sure what you're thinking, but in any case, showDocument() tells the browser to open a document, just what you want. You can have the document show up in a particular frame, as I said, or it can just replace the page the applet is on if you use the one-argument version.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: Hyperlinks