| Author |
Links?
|
Jennifer Sohl
Ranch Hand
Joined: Feb 28, 2001
Posts: 455
|
|
Is there any way to make text appear as a link? For example, how do I make an email address showing in a Jtextfield, a link that the user can click on. After this, then I need to know how to make it bring up a new memo in their e-mail when they click on it. The same with a URL link brining up Internet Explorer. Any help is appreciated!
|
 |
Kevin Yip
Ranch Hand
Joined: Oct 17, 2000
Posts: 110
|
|
|
Regarding the link, what I can think of is to use java.awt.event API to handle the mouse event. E.g. mousePressed(MouseEvent e) method of MouseListener interface.
|
 |
John Kilbourne
Ranch Hand
Joined: Aug 22, 2001
Posts: 30
|
|
You could use the URL class and getText() from the textField to construct a URL, then use openConnection() to connectto it. Here's the Sun tutorial: http://java.sun.com/docs/books/tutorial/networking/urls/index.html I'm not sure how you could view the page though without reinventing a browser in your program.
|
 |
 |
|
|
subject: Links?
|
|
|