JTextArea helparea = new JTextArea();helparea.append("\tJRE下载地址: www.sun.com (SUN官方网站)\n\n");把www.sun.com设置成超链接

解决方案 »

  1.   

    用JEditorPanel吧。TextArea里只能用纯文本。
      

  2.   


    超链接实现了。可是怎么设置它里面的字呢。让它多行显示
    就像我注释掉的一样。实现多行显示非超链接的文字 JEditorPane jEditorPane = new JEditorPane(); 
    jEditorPane.setEditable(false); 
    jEditorPane.setContentType("text/html"); 
    jEditorPane.setText("<html><body><a href=http://www.baidu.com>www.baidu.com</a></body></html>"); 
    // jEditorPane.setText("\n开发者:\n");
    // jEditorPane.setText("\t曲金鑫\n\n");
    // jEditorPane.setText("版本号:\n");
    // jEditorPane.setText("\t<1.0>版本\n\n");
    // jEditorPane.setText("数据库:\n" );
    // jEditorPane.setText("\t本系统采用的是mysql数据库\n");
    // jEditorPane.setText("\t其中.sql脚本随软件一起携带,保存在db文件夹下。\n");
      

  3.   

    这里换行应该用<br>而且你这么写setText的话,后面的就会把前面的全覆盖掉了,只剩下最后一句了
    你要把那段话拼起来,然后再setText
      

  4.   

    哎呀!!!!!一语惊醒梦中人啊!!!才发现我这个问题如此的白痴。
    里面明明有《html》《/html》标签。真。到分了。笨到家了。大家见笑咯