h******b 发帖数: 312 | 1 I want to wrap text in an editor area at a specific position, I have a
configure dialog to ask user specify line wrap at, say, 60 characters or 90
characters. Then I want the text to be displayed like that.
I can use JTextArea/JTextPane/JEditorPane, but no luck. setColumn() method
won't do it because it actually changed the size of the component, which I
don't want. I also tried to use styleddocument and override insert() method,
but in that way I have to insert new line characters which is not | g*****g 发帖数: 34805 | 2 did you setLineWrap(true)?
【在 h******b 的大作中提到】 : I want to wrap text in an editor area at a specific position, I have a : configure dialog to ask user specify line wrap at, say, 60 characters or 90 : characters. Then I want the text to be displayed like that. : I can use JTextArea/JTextPane/JEditorPane, but no luck. setColumn() method : won't do it because it actually changed the size of the component, which I : don't want. I also tried to use styleddocument and override insert() method, : but in that way I have to insert new line characters which is not
| h******b 发帖数: 312 | 3 yes, I did setLineWrap(true); but I want also it wrap at a specified position,
like this:
_______________________________________________________________
|heheheheheheheheheheheeeeeeeeeeeeeeeeeeeeee |
|heheheheheheheheheheheeeeeeeeeeeeeeeeeeeeee |
|heheheheheheheheheheheeeeeeeeeeeeeeeeeeeeee |
|heheheheheheheheheheheeeeeeeeeeeeeeeeeeeeee |
|heheheheheheheheheheheeeeeeeeeeeeeeeeeeeeee
【在 g*****g 的大作中提到】 : did you setLineWrap(true)?
| h******b 发帖数: 312 | 4 再问一遍!
//papaya
position,
this:
method
I
【在 h******b 的大作中提到】 : yes, I did setLineWrap(true); but I want also it wrap at a specified position, : like this: : _______________________________________________________________ : |heheheheheheheheheheheeeeeeeeeeeeeeeeeeeeee | : |heheheheheheheheheheheeeeeeeeeeeeeeeeeeeeee | : |heheheheheheheheheheheeeeeeeeeeeeeeeeeeeeee | : |heheheheheheheheheheheeeeeeeeeeeeeeeeeeeeee | : |heheheheheheheheheheheeeeeeeeeeeeeeeeeeeeee
|
|