Java Swing Tutorial - Java Desktop.mail()








Syntax

Desktop.mail() has the following syntax.

public void mail()  throws IOException

Example

In the following code shows how to use Desktop.mail() method.

import java.awt.Desktop;
//www.  ja  v  a  2  s. c  o m
public class Main {
  public static void main(String[] a)throws Exception {
      Desktop desktop = null;
      if (Desktop.isDesktopSupported()) {
        desktop = Desktop.getDesktop();
      }

       desktop.mail();
  }
}