Results 1 to 1 of 1
- 03-15-2012, 09:58 PM #1Member
- Join Date
- Mar 2012
- Rep Power
How can I draw a RTF formatted String to a JComponent? (no html)
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?
- By reach2sudhakar in forum New To JavaReplies: 4Last Post: 06-20-2011, 10:06 AM
- By elenora in forum Advanced JavaReplies: 2Last Post: 04-27-2011, 03:59 AM
- By tashimoto in forum New To JavaReplies: 2Last Post: 10-01-2010, 07:18 PM
- By higashij in forum Java ServletReplies: 0Last Post: 12-18-2009, 01:20 AM
- By DavidG24 in forum AWT / SwingReplies: 3Last Post: 05-20-2009, 07:05 AM