In my application, I have a JTextPane within a JScrollPane which in turn is in a panel. Here the wrapping happens at characters even in the middle of words. So the view is a word is being split in rows when seen b开发者_运维知识库y the user. However, this happens with java 1.4 and 1.5 but not with 1.6? In 1,6 it wraps only at word endings. Do any of the gurus here have a clue on this? Can you help me?
Does the version 1.4 code htmleditor kit formats the view in the viewfactory that way? Or is this a problem in my app code? Pls clarify Let me know if you need details further
Unless you are relying on formatting or styling of the text a way around it is to use a JTextArea
in a JScrollPane
and call textArea.setLineWrap(true)
and textArea.setWordWrap(false)
.
精彩评论