个位大哥大姐帮帮忙啊!·!·

解决方案 »

  1.   

    继承JLabel,添加MouseListener,鼠标按下事件发生时
    Runtime.getRuntime().exec("cmd/"+ htmPath); // 只适合Windows系统
      

  2.   

    这个也可以参考下
    http://community.csdn.net/Expert/topic/4858/4858937.xml?temp=.8753778
      

  3.   

    JLabel linklabel=new JLabel("<html><a href='http://www.google.com'>google</a></html>");
    linklabel.addMouseListener(new MouseAdapter(){
    public void mouseClicked(MouseEvent e){
    try{
    Runtime.getRuntime().exec("cmd/"+"http://www.google.com");
    }catch(Exception ex){
    ex.printStackTrace();
    }
    }
    });
    我这样写怎么不对啊,报异常java.io.IOException: CreateProcess: cmd/http://www.google.com error=2
      

  4.   

    粘少了一点,不好意思
    String url = "http://www.google.com";
    Runtime.getRuntime().exec("explorer " + url);
    或者
    Runtime.getRuntime().exec("cmd.exe /c start " + url);