Results 1 to 1 of 1
- 03-15-2012, 09:58 PM #1
Member
- Join Date
- Mar 2012
- Posts
- 1
- Rep Power
- 0
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?
Similar Threads
-
string date to formatted date string
By reach2sudhakar in forum New To JavaReplies: 4Last Post: 06-20-2011, 10:06 AM -
How to draw a cursor for a String
By elenora in forum Advanced JavaReplies: 2Last Post: 04-27-2011, 03:59 AM -
Using JComponent methods on a JComponent that was found using .getComponents()
By tashimoto in forum New To JavaReplies: 2Last Post: 10-01-2010, 07:18 PM -
Sending a formatted string to a servlet
By higashij in forum Java ServletReplies: 0Last Post: 12-18-2009, 01:20 AM -
Draw String in Rectangle
By DavidG24 in forum AWT / SwingReplies: 3Last Post: 05-20-2009, 07:05 AM


LinkBack URL
About LinkBacks
Reply With Quote

Bookmarks