Solved

email

Posted on 2004-08-31
9
166 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
3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

 
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:Mayank S
ID: 11952793
>> it should not be executed in the event handling thread

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

Featured Post

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
json example 39 132
base64 decode encode 12 122
Image decoding from Camera 3 72
difference of if loops 23 42
INTRODUCTION Working with files is a moderately common task in Java.  For most projects hard coding the file names, using parameters in configuration files, or using command-line arguments is sufficient.   However, when your application has vi…
For beginner Java programmers or at least those new to the Eclipse IDE, the following tutorial will show some (four) ways in which you can import your Java projects to your Eclipse workbench. Introduction While learning Java can be done with…
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…
This tutorial will introduce the viewer to VisualVM for the Java platform application. This video explains an example program and covers the Overview, Monitor, and Heap Dump tabs.

895 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

15 Experts available now in Live!

Get 1:1 Help Now