Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Different colored text?

 
Brian Legg
Ranch Hand
Posts: 488
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Using standard output to the consul can you have it all printed in standard white with certain words printed in a different color to highlight them? I guess I'm asking if there is a way to change the font color on the screen without changing ALL the font color?

Thanks!
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 34973
379
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Brian,
Not easily. It might be possible using JNI though. I'm not sure.
 
Rob Spoor
Sheriff
Pie
Posts: 20665
65
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm pretty sure it is, but it's not going to be easy. Perhaps you can find an existing 3rd party library that already can do this.
 
Ulf Dittmer
Rancher
Posts: 42968
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Maybe sending http://en.wikipedia.org/wiki/ANSI_escape_code to the console works; coloring text is one of the features it supports.

Something like JChassis ANSI Terminal Controller or javacurses may also fit the bill.
[ November 25, 2008: Message edited by: Ulf Dittmer ]
 
Brian Legg
Ranch Hand
Posts: 488
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for the suggestions, I had a feeling that Java wouldn't support it as that would cause some OS dependency. I'll have to check out the 3rd party programs!
 
Ulf Dittmer
Rancher
Posts: 42968
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I briefly tested the JChassis stuff on my Unix console, and it worked fine. I think the javacurses library relies on JNI, so it would be trickier to use.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic