写了个GUI组件,当用户点击的时候打开系统默认的邮件发送软件并发送邮件
就跟网页上的邮件连接一样的,我使用Runtime来执行"Explorer mailto:[email protected]"这个命令
但是会打开一个网页然后才打开outlook,怎么把这个网页去掉呢

解决方案 »

  1.   

    请查看有关runtime类中的exec方法 这个方法能调用外部程序
      

  2.   

    在 Windows 的 DOS 窗口里,敲下面的命令,可以弹出一个写信的窗口:
        C:\> start mailto:[email protected]比之于 Explorer mailto:[email protected] 命令,它的好处是不会出现一个多余的窗口。希望这对楼主能有所帮助。
      

  3.   

    楼上的没看清楚我的问题,晕,我不是不会用runtime
      

  4.   

    String ss = System.getProperty("user.dir");
          String s = "cmd /E:ON /c start \"\"  \"" + ss + "\\system\\notepad.exe\"";
          Runtime hello = Runtime.getRuntime();
          try {
            hello.exec(s);
          }
          catch (Exception ee) {
            JOptionPane.showMessageDialog(null, "打开记事本失败!", "警告",
                                          JOptionPane.ERROR_MESSAGE);
          }
    =================================================================================
    这是打开记事本,打开outlook应该也差不多吧。