Using ­ in Java HTML aware Component

一笑奈何 提交于 2019-12-04 17:44:08

http://java-sl.com/Hyphenation_In_JEditorPane.html That's an example of custom hyphnation. You can use the same approach and change the HTMLEditorKit to use your hyphens.

Pascal Qyy

Many browsers do not handle this character. It is preferable to use the name of the entity (­) instead of the ISO numeric entity (­).

But this entity is pretty bad handled by most browsers.

​ is just a zero width space character.

The simpler is: (but the hyphen is always visible...)

<p>longlonglong-&#8203;longlonglong</p>

And you can even try this (but I don't think that you see your hyphen...):

<p>longlonglong&shy;&#8203;longlonglong</p>

But I don't understand why you insert plain-text just after an <html> node, this should not ease the task of the browser, isn't it?

Otherwise, on what browser(s) do you test your code? Because this work perfectly on the lastest versions of Chrome and Firefox:

<p>longlonglong&shy;longlonglong</p>

Anyway you'll may be interested by the <wbr> tag, and this article dedicated to the soft hyphen problem...

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!