如题。

解决方案 »

  1.   

    import java.awt.event.ActionEvent;
    import java.awt.event.ActionListener;
    import java.io.IOException;import javax.swing.*;public class OpenIE extends JFrame { public OpenIE() {
    JButton button = new JButton("Open");
    button.addActionListener(new ActionListener(){ public void actionPerformed(ActionEvent e) {
    // TODO Auto-generated method stub
    try {
    String[] strs = {"C:\\Program Files\\Internet Explorer\\iexplore.exe", 
    "http://dzh.mop.com/topic/readSub_5661107_0_0.html"};
    Runtime.getRuntime().exec(strs);
    } catch (IOException e1) {
    // TODO Auto-generated catch block
    e1.printStackTrace();
    }
    }

    });

    this.getContentPane().add(button);
    this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    this.setBounds(200, 200, 200, 200);
    }
    /**
     * @param args
     */
    public static void main(String[] args) {
    // TODO Auto-generated method stub
    new OpenIE().setVisible(true);
    }}
      

  2.   

    C:\\Program Files\\Internet Explorer\\
    用这这样的地址很有问题。给个比较健壮的:/* ============================================================== 
     * $Id URLOpener.java,v 1.0 xio Exp $
     * Created on [2005-5-23 8:51:41] by xio
     * ==============================================================
     * 
     * 项目名称:$ XioLog $
     */
    package com.wodar.log.util;import java.lang.reflect.Method;import javax.swing.JOptionPane;import org.apache.commons.logging.Log;
    import org.apache.commons.logging.LogFactory;/**
     * <p>Title: </p>
     * <p>Description: </p>
     * <p>Copyright: Copyright (c) 2005</p>
     * <p>Company: wodar.com</p>
     * <p>URLOpener.java</p>
     * @author xio
     * @version $Revision:1.0 $ $Date 2006-1-16,19:34:21$
     */
    public class URLOpener {
        public static void openURL(String url) {
            String osName = System.getProperty("os.name");
            try {
                if (osName.startsWith("Mac OS")) {
                    Class fileMgr = Class.forName("com.apple.eio.FileManager");
                    Method openURL = fileMgr.getDeclaredMethod("openURL",
                            new Class[] { String.class });
                    openURL.invoke(null, new Object[] { url });
                } else if (osName.startsWith("Windows")) {
                    Runtime.getRuntime().exec(
                            "rundll32 url.dll,FileProtocolHandler " + url);
                } else { //assume Unix or Linux
                    String[] browsers = { "firefox", "opera", "konqueror",
                            "epiphany", "mozilla", "netscape" };
                    String browser = null;
                    for (int count = 0; count < browsers.length && browser == null; count++)
                        if (Runtime.getRuntime().exec(
                                new String[] { "which", browsers[count] })
                                .waitFor() == 0)
                            browser = browsers[count];
                    if (browser == null) {
                        throw new Exception("Could not find web browser");
                    } else {
                        Runtime.getRuntime().exec(new String[] { browser, url });
                    }
                }
            } catch (Exception ex) {
                log.warn("打开浏览器时出错:" + ex.getMessage());
                JOptionPane.showMessageDialog(null, "打开浏览器时出错:"
                        + ex.getLocalizedMessage());
            }
        }    private static Log log = LogFactory.getLog(URLOpener.class);
    }
      

  3.   

    Runtime.getRuntime().exec("C:\\Program Files\\Internet Explorer\\iexplore.exe http://doc.c06.net/tea/node/N39885L1PnullLnull.html");  这样写就可以了