简体   繁体   English

如何自动换行存储在JTextPanes中的文本,这些文本是JList中的单元格

[英]How to word wrap text stored in JTextPanes which are cells in a JList

I created a JList that had JTextAreas which word wrapped appropriately when setLineWrap(true); setWrapStyleWord(true); 我创建了一个具有JTextAreasJList ,当setLineWrap(true); setWrapStyleWord(true);时,该单词适当地包装setLineWrap(true); setWrapStyleWord(true); setLineWrap(true); setWrapStyleWord(true); was used. 被使用了。 These aren't available for JTextPane and my god forsaken text isn't wrapping. 这些不适用于JTextPane ,我的上帝遗弃的文字不包装。 Any advise? 有什么建议吗?

使用此示例在JTextPane中实现您自己的包装http://java-sl.com/wrap.html

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM