This week's book giveaway is in the OO, Patterns, UML and Refactoring forum.
We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line!
See this thread for details.
The moose likes Swing / AWT / SWT and the fly likes replacing characters in rtfeditorkit Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "replacing characters in rtfeditorkit" Watch "replacing characters in rtfeditorkit" New topic

replacing characters in rtfeditorkit

mark goking
Ranch Hand

Joined: Aug 18, 2009
Posts: 155
greetings. i have a little problem with my code. try to enter some few text in as many lines are you want. and press alt-p, some symbols will appear replacing newline and space characters.

my problem is when the caret cursor's position is beside the last line's text, that last line will disappear instead of being formatted. but if the caret position is in the last line, then everything will be formatted correctly and there are no missing text.


line 1: abcd1
line 2: abcd2
line 3: [caret cursor]
formats correctly

line 1: abcd1
line 2: abcd2 [caret cursor]

when i press alt-p only line 1 will be shown and formatted, line 2 is gone. i figure the problem may be somewhere in the scanmiddledotduplicate() method in the myrtfeditorkit class.

i have attached sample code ready to run and test

anyone got ideas? thanks

Website/Java Games:
Tech Blog:
I’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link:
subject: replacing characters in rtfeditorkit
It's not a secret anymore!