dcsimg
"Slicing" horizontal pieces out of JTextPane!_NEWLINE_!Override paint()? where? which one?
0 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Anonymous
Posted On:   Thursday, November 21, 2002 07:03 PM

Howdy, I have a JTextPane, and I want to remove lines of text, that is, I want the following text: The quick brown fox jumped over the lazy dog to appear as: The quick brown fox the lazy dog With, say a horizontal line to represent the missing text. If I could begin to find where the drawing is occuring, I think i could tackle this problem, but have no clue where to begin. I have no problem with finding the positions in the string to remove the text with my program, and track exactly where text is missing. But how or what classes do I need to work with to tweak the painting of the component to do as I say? :) I have looked through the source for many of th   More>>

Howdy,
I have a JTextPane, and I want to remove lines of text, that is, I want the following text:


The quick brown fox
jumped over
the lazy dog


to appear as:
The quick brown fox
the lazy dog


With, say a horizontal line to represent the missing text. If I could begin to find where the drawing is occuring, I think i could tackle this problem, but have no clue where to begin. I have no problem with finding the positions in the string to remove the text with my program, and track exactly where text is missing. But how or what classes do I need to work with to tweak the painting of the component to do as I say? :)
I have looked through the source for many of the base swing classes, as well as looking through the TextUI stuff. Maybe I just didn't see it, or the drawing is not centralized enough for me to notice, but I am looking for something like (see obviously Pseudocody notion):


while(lineOfTextExistsInString)
drawstring(properIndent,belowLastStringDrawnPosition);


I know it cannot be nearly that simple, but I am looking for where FontMetrics are used to draw in the editor, etc, anything just to get a start, and cannot find where to begin tweaking to suit my purposes. I am more than ready to override paint or whatever... Any suggestions or questions would be great, or if you could point me to similar work online somewhere that would at least give me a start... I have searched the forums for several hours now, and am either not searching for the right thing, or... Again, any help would be appreciated.




Thank you.
Brian

   <<Less
About | Sitemap | Contact