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

馋奶兔 提交于 2019-12-25 06:43:44

问题


I created a JList that had JTextAreas which word wrapped appropriately when setLineWrap(true); setWrapStyleWord(true); was used. These aren't available for JTextPane and my god forsaken text isn't wrapping. Any advise?


回答1:


USe this example to implement your own wrap in JTextPane http://java-sl.com/wrap.html



来源:https://stackoverflow.com/questions/6866627/how-to-word-wrap-text-stored-in-jtextpanes-which-are-cells-in-a-jlist

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