This week's book giveaway is in the Agile and Other Processes forum.
We're giving away four copies of The Little Book of Impediments (e-book only) and have Tom Perry on-line!
See this thread for details.
Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

hyperlink in a applet

 
anusha mandava
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hey..... i am an amatuer in applets and i wish to know how can I insert a hyperlink(e-mail id) in a applet...sounds silly but not for beginners like me.....hope yo hear soon from u all...
 
Tanveer Rameez
Ranch Hand
Posts: 158
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi
WEll,I dunno how you make a hyperlike on an applet, but I tell you how to lauch a browser on click of a button. Say on click of a button the actionPerformed method is invoked. then:
<code>
URL url;
String link="http://www.yoursite.com/yourfile.html";
try {
url= new URL (link);
String window="_blank";
/* "window" can be initialized as "_blank", "_top","_left,"_right", "_bottom" or simply the name of the necessary frame window*/
getAppletContext().showDocument(url,window); /* open url in necessary window*/
</code>
I would also like to know how a hyperlink is created on the applet, where the mouse cursor turns to a hand automatically on placing it on top it.
regards
Tanveer
 
Max
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hey guys,
the cursor will turn into the hand shape with the following line
MyComponent.setCursor(new Cursor(Cursor.HAND_CURSOR));
let's say for the Button b = new Button("OK");
write:
b.setCursor(new Cursor(Cursor.HAND_CURSOR));

 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic