Results 1 to 3 of 3
- 01-29-2011, 02:11 PM #1
Member
- Join Date
- Dec 2010
- Posts
- 8
- Rep Power
- 0
Different text color in JTextArea
Hi everyone.
I am testing a application where I have a JTextArea. In that text area I want some text with black text and another text with red color(for error messages).
But when I change color at the text area it change the whole area(all text) and not the color I just set before I append the text.
In my method I check if it is a normal text or a error text and then I set the color for text area and then I append, next time I want append text to the area i set a new color and then append the text.
Is there any thing I can do to have text with different color in that text area?
I have search but dosent found any solution for this.
Regards Patrik
-
Your best bet is not to use a JTextArea for these types of situations but rather to use an editor pane or text pane: How to use Editor Panes and TextPanes
- 01-29-2011, 02:21 PM #3
Member
- Join Date
- Dec 2010
- Posts
- 8
- Rep Power
- 0
Similar Threads
-
Changing text color in SWT
By ourimaler in forum SWT / JFaceReplies: 1Last Post: 06-02-2010, 01:08 PM -
text color
By jpito in forum Advanced JavaReplies: 1Last Post: 11-18-2009, 12:33 AM -
Need Help showing text in JTextArea
By GuyFawkes in forum AWT / SwingReplies: 3Last Post: 05-05-2008, 09:19 AM -
JTextArea - text align
By bradder in forum AWT / SwingReplies: 1Last Post: 11-29-2007, 07:08 PM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks