Solved

email

Posted on 2004-08-31
9
170 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
Space-Age Communications Transitions to DevOps

ViaSat, a global provider of satellite and wireless communications, securely connects businesses, governments, and organizations to the Internet. Learn how ViaSat’s Network Solutions Engineer, drove the transition from a traditional network support to a DevOps-centric model.

 
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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
tomcat startup error 5 107
spring jars download 1 36
iterator/ListIterator approach 17 41
Using jdbcTemplate.batchUpdate to improve INSERT performance 6 24
Java Flight Recorder and Java Mission Control together create a complete tool chain to continuously collect low level and detailed runtime information enabling after-the-fact incident analysis. Java Flight Recorder is a profiling and event collectio…
Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
Viewers learn about the scanner class in this video and are introduced to receiving user input for their programs. Additionally, objects, conditional statements, and loops are used to help reinforce the concepts. Introduce Scanner class: Importing…
Viewers will learn about arithmetic and Boolean expressions in Java and the logical operators used to create Boolean expressions. We will cover the symbols used for arithmetic expressions and define each logical operator and how to use them in Boole…

808 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