rimmer0007
asked on
dont know if this is relevant to java but here goes
i have opened a web site in a Jeditorpane, how can i click on a email address and open up say outlook express 6 ?
i have opened a web site in a Jeditorpane, how can i click on a email address and open up say outlook express 6 ?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Add a HyperlinkListener and Runtime.exec OE.
to start up the mail client try:
Runtime.getRuntime().exec( "cmd.exe /C start mailto:xxx@yyy.com");
Runtime.getRuntime().exec(
your listener would look something like:
public class MyHyperlinkListener implements HyperlinkListener
{
public void hyperlinkUpdate(HyperlinkE vent e)
{
URL url = e.getURL();
if (url.getProtocol().startsW ith("mailt o"))
{
Runtime.getRuntime().exec( "cmd.exe /C start "+url);
}
}
}
public class MyHyperlinkListener implements HyperlinkListener
{
public void hyperlinkUpdate(HyperlinkE
{
URL url = e.getURL();
if (url.getProtocol().startsW
{
Runtime.getRuntime().exec(
}
}
}
Start the program in a separate thread in the listener - it should not be executed in the event handling thread
>> it should not be executed in the event handling thread
Should it matter if we're not using waitFor () ?
Should it matter if we're not using waitFor () ?