Solved

email

Posted on 2004-08-31
9
164 Views
Last Modified: 2013-11-24
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 ?
0
Comment
Question by:rimmer0007
  • 3
  • 2
9 Comments
 
LVL 92

Accepted Solution

by:
objects earned 205 total points
ID: 11947770
you need to add a HyperlinkListener to your pane (assuming the email address is a link), and have it use Runtime.exec() to fire up outlook.
0
 
LVL 86

Expert Comment

by:CEHJ
ID: 11947771
Add a HyperlinkListener and Runtime.exec OE.
0
 
LVL 92

Expert Comment

by:objects
ID: 11947791
to start up the mail client try:

Runtime.getRuntime().exec("cmd.exe /C start mailto:xxx@yyy.com");    
0
Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 
LVL 92

Expert Comment

by:objects
ID: 11947805
your listener would look something like:

public class MyHyperlinkListener implements HyperlinkListener
{
   public void hyperlinkUpdate(HyperlinkEvent e)
   {
       URL url = e.getURL();
       if (url.getProtocol().startsWith("mailto"))
       {
          Runtime.getRuntime().exec("cmd.exe /C start "+url);    
       }
   }
}

 
0
 
LVL 86

Expert Comment

by:CEHJ
ID: 11947827
Start the program in a separate thread in the listener - it should not be executed in the event handling thread
0
 
LVL 30

Expert Comment

by:mayankeagle
ID: 11952793
>> it should not be executed in the event handling thread

Should it matter if we're not using waitFor () ?
0

Featured Post

Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Suggested Solutions

Java functions are among the best things for programmers to work with as Java sites can be very easy to read and prepare. Java especially simplifies many processes in the coding industry as it helps integrate many forms of technology and different d…
In this post we will learn how to connect and configure Android Device (Smartphone etc.) with Android Studio. After that we will run a simple Hello World Program.
Viewers learn about the “for” loop and how it works in Java. By comparing it to the while loop learned before, viewers can make the transition easily. You will learn about the formatting of the for loop as we write a program that prints even numbers…
The viewer will learn how to implement Singleton Design Pattern in Java.

706 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now