• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Multi-color JTextAreas

 
Nick George
Ranch Hand
Posts: 38
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is it at all possible to have the text in a JTextArea be of multiple colors? i was hoping for something of the sort
text.setColor(int startpos,int endpos,Color c);
but found no such method
 
Ernest Friedman-Hill
author and iconoclast
Marshal
Pie
Posts: 24208
35
Chrome Eclipse IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Not JTextArea, but its more accomplished cousins JEditorPane and JTextPane support this. They're both a bit tricky to use, but this turorial will get you started.
[ edited mildly confusing typo -ds ]
[ January 25, 2004: Message edited by: Dirk Schreckmann ]
 
Dirk Schreckmann
Sheriff
Posts: 7023
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Moving this to the Swing / JFC / AWT forum...
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic