JEditorPane和JTextPane订阅号和服务号的区别别

java超链接怎么实现?
java超链接怎么实现?
09-09-04 &
对于JEditorPane,JTextPane,JTextArea,JLabel可以使用setText(&&html&&A   href=''&test&/A&&/html&&)对于JEditorPane使用setEditorKitForContentType(&text/html&,   new   PatchedHTMLEditorKit());  addHyperlinkListener(HyperlinkListener  ...  );==================写一个例子~仅供参考====import javax.swing.JEditorPimport javax.swing.JFimport javax.swing.event.HyperlinkEimport javax.swing.event.HyperlinkLpublic class Hyperlink extends JFrame { public Hyperlink(){  JEditorPane jEditorPane = new JEditorPane();  jEditorPane.setEditable(false);  jEditorPane.setContentType(&text/html&);  jEditorPane.setText(&&html&&body&&a href=&baidu&/a&&/body&&/html&&);  jEditorPane.addHyperlinkListener(new HyperlinkListener() {   public void hyperlinkUpdate(HyperlinkEvent e) {    if (e.getEventType() == HyperlinkEvent.EventType.ACTIVATED) {     try {      String command = &explorer.exe &        + e.getURL().toString();      Runtime.getRuntime().exec(command);     } catch (Exception ex) {      ex.printStackTrace();      System.err.println(&connection error&);     }    }   }  });  this.getContentPane().add(jEditorPane);  this.setDefaultCloseOperation(EXIT_ON_CLOSE); } public static void main(String[] args) {  Hyperlink temp = new Hyperlink();  temp.setSize(200,200);  temp.setVisible(true); } }
请登录后再发表评论!
你这样怎么再往里输入文字,我试了试实现不了,你知道怎么办吗?谢谢
请登录后再发表评论!温馨提示!由于新浪微博认证机制调整,您的新浪微博帐号绑定已过期,请重新绑定!&&|&&
I am a quiet boy.
LOFTER精选
网易考拉推荐
用微信&&“扫一扫”
将文章分享到朋友圈。
用易信&&“扫一扫”
将文章分享到朋友圈。
阅读(4963)|
用微信&&“扫一扫”
将文章分享到朋友圈。
用易信&&“扫一扫”
将文章分享到朋友圈。
历史上的今天
loftPermalink:'',
id:'fks_',
blogTitle:'JTextPane自动换行',
blogAbstract:'JTextPane没有setLineWrap(boolean & t);方法,StyledDocument控制着JTextPane中的显示,自动换行,当你把JTextPane设置成text/html格式,html语法将控制它的显示,这时换行将通过 &br& 来实现,想要自动换行就需要用到表格,一个设置好宽度的表格可以使其中的文字自动折行,这完全和网页上的做法相同。&如果确定采用text/html格式,你可以使用JTextPane的父类JEditorPane,建议服务器端采取推技术。&',
blogTag:'',
blogUrl:'blog/static/',
isPublished:1,
istop:false,
modifyTime:0,
publishTime:6,
permalink:'blog/static/',
commentCount:0,
mainCommentCount:0,
recommendCount:0,
bsrk:-100,
publisherId:0,
recomBlogHome:false,
currentRecomBlog:false,
attachmentsFileIds:[],
groupInfo:{},
friendstatus:'none',
followstatus:'unFollow',
pubSucc:'',
visitorProvince:'',
visitorCity:'',
visitorNewUser:false,
postAddInfo:{},
mset:'000',
remindgoodnightblog:false,
isBlackVisitor:false,
isShowYodaoAd:true,
hostIntro:'I am a quiet boy.\nI love my
hmcon:'1',
selfRecomBlogCount:'0',
lofter_single:''
{list a as x}
{if x.moveFrom=='wap'}
{elseif x.moveFrom=='iphone'}
{elseif x.moveFrom=='android'}
{elseif x.moveFrom=='mobile'}
${a.selfIntro|escape}{if great260}${suplement}{/if}
{list a as x}
推荐过这篇日志的人:
{list a as x}
{if !!b&&b.length>0}
他们还推荐了:
{list b as y}
转载记录:
{list d as x}
{list a as x}
{list a as x}
{list a as x}
{list a as x}
{if x_index>4}{break}{/if}
${fn2(x.publishTime,'yyyy-MM-dd HH:mm:ss')}
{list a as x}
{if !!(blogDetail.preBlogPermalink)}
{if !!(blogDetail.nextBlogPermalink)}
{list a as x}
{if defined('newslist')&&newslist.length>0}
{list newslist as x}
{if x_index>7}{break}{/if}
{list a as x}
{var first_option =}
{list x.voteDetailList as voteToOption}
{if voteToOption==1}
{if first_option==false},{/if}&&“${b[voteToOption_index]}”&&
{if (x.role!="-1") },“我是${c[x.role]}”&&{/if}
&&&&&&&&${fn1(x.voteTime)}
{if x.userName==''}{/if}
网易公司版权所有&&
{list x.l as y}
{if defined('wl')}
{list wl as x}{/list}安全检查中...
请打开浏览器的javascript,然后刷新浏览器
< 浏览器安全检查中...
还剩 5 秒&}

我要回帖

更多关于 订阅号和服务号的区别 的文章

更多推荐

版权声明:文章内容来源于网络,版权归原作者所有,如有侵权请点击这里与我们联系,我们将及时删除。

点击添加站长微信