请问Swing中用按钮做超链接该怎么做呢

解决方案 »

  1.   

    JBUTTON  中addActionListener 点击时在actionPerformed中连接到站点  和HTML的超链接不一样
      

  2.   

    l2fprod免费的swing插件jlinkbutton可以实现
    http://blog.csdn.net/diggywang/archive/2006/11/23/1406821.aspx
      

  3.   

    在我的机器上我是这样实现的,JDK1.5
    在一个swing componet上加上listener,然后
    class MyItemListener implements ActionListener{
      public void actionPerformed(ActionEvent e) {
         try{
             String command="E:/Program Files/Maxthon/Max.exe http://www.china.com";
    Runtime.getRuntime().exec(command);
         } catch (Exception ex){
    ex.printStackTrace();
         }
      }
    }
      

  4.   

    max是我的浏览器,class Runtime 在java.lang.* 中
      

  5.   

    Runtime.getRuntime().exec("cmd /c start http://www.baidu.com");