This week's book giveaway is in the Jython/Python forum.
We're giving away four copies of Murach's Python Programming and have Michael Urban and Joel Murach on-line!
See this thread for details.
Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Displaying lines with multiple colors  RSS feed

 
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...

 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!