• Post Reply Bookmark Topic Watch Topic
  • New Topic

Displaying lines with multiple colors

 
Robert Miller
Ranch Hand
Posts: 56
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm working on a project requiring me to maintain a window with multiple lines of text, each of which is to be displayed using a particular color. My first instinct was to use a JTextArea wrapped in a JScrollPane, but that does not give me the color control I need.

Similar code in this project solves the problem by directly extending JComponent and overriding paintComponent(), but I figure there has to be a more straightforward way of handling this problem. Can anyone tell me how to do this?

Thanks,

Robert
 
jefff willis
Ranch Hand
Posts: 113
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
try this...

 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!