I have my custom JComponent which do a lot of drawing operations.
They also include drawStrings for text paragraphs, but now Id like to format the text (in a seperate window with jtextpane or another RTF editor) (bold, font-size, align, font-color, lists) and show this formatted text in my own component.
Id like to do that without bufferedimages because if i have a big jcomponent full with images I would get a overflow error (RAM)
Something like with AttributedString could work, but how?
I don't really know how to get the RTF-Text out of the Jtextpane (or if there is a better editor plz tell me) and draw it in the "paintComponent(Graphics g)" method.
The Editor is just used to format the text easily, not for the presentation (which is done with my own component)
Can anyone help me please?
Thanks for your help,
so i create an AttributeString and then apply the RTF-formattings in it?
do you know how I can extrude the RTF information to an adequate AttributedString? e.g. a function which transforms the formatted text to an AttributedString like
public AttributedString getAttrString(String plainRTF){
...
}
Thanks a lot