i need to make a JTextArea like that in pic
a.JPG
how i can make it :/
Thanks
Welcome to the Java Programming Forums
The professional, friendly Java community. 21,500 members and growing!
The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.
>> REGISTER NOW TO START POSTING
Members have full access to the forums. Advertisements are removed for registered users.
i need to make a JTextArea like that in pic
a.JPG
how i can make it :/
Thanks
You can use HTML in a JTextArea. See How to Use HTML in Swing Components
Zuckerberg (January 17th, 2014)
You might be thinking of a JTextPane/JEditorPane, in which the content type can be set to "text/html". If you wish to change the color of a particular range of text within a JTextArea, modify its highlighter with a new HighlightPainter, or alternatively use a TextComponent that allows for HTML or has the appropriate Document (StyledDocument) to allow for custom styles.
ChristopherLowe (January 16th, 2014)
big thanks i hope it work
i don't understand you copeg :/
The following is just an example:
JEditorPane editor = new JEditorPane("text/html", "<html><body>Hello<br><font color='red'>World</font><br><font size='7'>Bye</font></body></html>");
It's not the only possibility. The other well known option is to use a "styled" text (using directly a StyledDocument object) in JTextPane.
Andrea, www.andbin.net — SCJP 5 (91%) – SCWCD 5 (94%)
Useful links for Java beginners – My new project Java Examples on Google Code
Zuckerberg (January 17th, 2014)
thanks it's work ^_^ andbin