为什么不写完整
</a></html>

解决方案 »

  1.   

    String addr = "\"http://www.csdn.net\"";JLabel l = new JLabel("<html><a href=" + addr + ">InterFax</a></html>”);
      

  2.   

    当然不能点击,你没有让它监听什么事件,
    而且即使在JEditorPane中,你若想href表现出和ie中鼠标变化的效果,也需要自己写代码的!
      

  3.   

    可以加个监听事件 打开浏览器到相映的网站
    Runtime.getRuntime().exec("C:\\Program Files\\Internet Explorer\\IEXPLORE.EXE www.csdn.net");
      

  4.   

    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;public class LinkFrame extends JFrame implements ActionListener{
    private JButton lb=null;
    private String str = "http://www.sohu.com";
    public LinkFrame(){

    lb = new JButton("<html><a href=" + str + ">InterFax</a></html>");
    lb.addActionListener(this);
    Container cn = this.getContentPane();
    cn.add(lb);
    this.pack();
    this.show();
    }

    public void actionPerformed(ActionEvent e){
    try{
    Runtime.getRuntime().exec("C:\\Program Files\\Internet Explorer\\IEXPLORE.EXE "+str);
    }
    catch(Exception ee)
    {
    ee.printStackTrace();
    }
    }
    public static void main(String[] args){
         new LinkFrame();
        }
    }
      

  5.   

    呵呵 bondhou() 
    楼主说的是JLabel,不是JButton
      

  6.   

    可是这样加了后,点一下Button就会连上的.
    但是如果像IE哪样只点href时才行的话要怎么办