button.setLabel("<html><a href=\"http:\\www.cnblogs.com\angelsinklow">angelsinklow</a></html>");
------------------------
如果用start的话,这样写
Runtime.getRuntime().exec("cmd /c start ‘http:\\www.cnblogs.com\angelsinklow");
------------------------------------
Runtime.getRuntime().exec("iexplore http://www.cnblogs.com/angelsinklow");
对于JEditorPane,JTextPane,JTextArea,JLabel可以使用
setText("<html><A href='http://www.baidu.com'>test</A></html>")
对于JEditorPane使用
setEditorKitForContentType("text/html", new PatchedHTMLEditorKit());
addHyperlinkListener(HyperlinkListener ... );
需要引入java.net.url包。
try{getAppletContext().showDocument(new URL("http:\\www.cnblogs.com\angelsinklow"),"打开位置");}
catch(Exception ex) {System.out.println("error"); }
就超链接了。