• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Applets and Hyperlinks

 
Sam Bluesman
Ranch Hand
Posts: 191
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can u attach a hyperlink to an applet so that when a user clicks anywhere on the applet it takes the user to a different website or webpage?

If so...how?
 
Joe Ess
Bartender
Posts: 9297
10
Linux Mac OS X Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please change your displayed name to conform to our
naming policy. In short, your name must be a first name and last name, separated by a space and not obviously fake.
Now, about your question. No, but you can do something similar by calling AppletContext.showDocument() to load a new URL in the browser.
 
Swathi Prakash
Ranch Hand
Posts: 49
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
urlField = new TextField("http://localhost/");

userUrl = new URL(s);
urlField.setText(userUrl.toString());
getAppletContext().showDocument(userUrl, "_blank");
 
Sam Bluesman
Ranch Hand
Posts: 191
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That is my real name: Mr. Sam Bluesman
 
Sam Bluesman
Ranch Hand
Posts: 191
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
is that better? Or would you like me to put Samual? i wouldnt want you to get upset
 
Joe Ess
Bartender
Posts: 9297
10
Linux Mac OS X Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
We ask that people use their real names because we want this place to be friendly to the newcomer and people seem to take the anynomity of the internet as a license to be short-tempered and insulting. Thanks for making the change and enjoy the Ranch.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic