你试一下
String s1="start C:\\Winnt\\System32\\telnet.exe";
 Runtime.getRuntime().exec(s1);

解决方案 »

  1.   

    在applet中估计不好办,我有一个折中的办法
        try{
        URL url = new URL("http://host/redirect.htm");
        this.getAppletContext().showDocument(url,"_blank");
        }
        catch(Exception ee)
        {
          ee.printStackTrace();
        }
    然后写一个中转的htm文件redirect.htm
    <Script language="javascript">
    this.location="telnet://bbs.gznet.edu.cn";
    </script>同样达到你要的效果
      

  2.   

    try{
        URL url = new URL("http://192.168.4.36/redirect.htm");
        this.getAppletContext().showDocument(url,"_blank");
        }
        catch(Exception ee)
        {
          ee.printStackTrace();
        }怎么没有反映啊,也没有任何异常
    在浏览器中输入http://192.168.4.36/redirect.htm就可以
      

  3.   

    在贴一次,完整的
    package test;import java.awt.*;
    import java.awt.event.*;
    import java.applet.*;
    import javax.swing.*;
    import java.io.*;
    import java.net.*;public class Applet2 extends Applet {
      private boolean isStandalone = false;
      private JButton jButton1 = new JButton();
      //Get a parameter value
      public String getParameter(String key, String def) {
        return isStandalone ? System.getProperty(key, def) :
          (getParameter(key) != null ? getParameter(key) : def);
      }  //Construct the applet
      public Applet2() {
      }
      //Initialize the applet
      public void init() {
        try {
          jbInit();
        }
        catch(Exception e) {
          e.printStackTrace();
        }
      }
      //Component initialization
      private void jbInit() throws Exception {
        jButton1.setText("jButton1");
        jButton1.addActionListener(new java.awt.event.ActionListener() {
          public void actionPerformed(ActionEvent e) {
            jButton1_actionPerformed(e);
          }
        });
        this.add(jButton1, null);
      }
      //Start the applet
      public void start() {
      }
      //Stop the applet
      public void stop() {
      }
      //Destroy the applet
      public void destroy() {
      }
      //Get Applet information
      public String getAppletInfo() {
        return "Applet Information";
      }
      //Get parameter info
      public String[][] getParameterInfo() {
        return null;
      }  void jButton1_actionPerformed(ActionEvent e) {
        try{
            URL url = new URL("http://192.168.4.36/redirect.htm");
            this.getAppletContext().showDocument(url,"_blank");
            }
            catch(Exception ee)
            {
              ee.printStackTrace();
            }
      }
    }
      

  4.   

    准确说是在linux下的浏览器(netscape)就没有反映
    在windows下的ie就行