File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Beginning Java and the fly likes Changing colors in Command Prompt Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of REST with Spring (video course) this week in the Spring forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Changing colors in Command Prompt" Watch "Changing colors in Command Prompt" New topic

Changing colors in Command Prompt

David Maddox

Joined: Feb 25, 2004
Posts: 12
I am writing a stock sim for a class project and i was wondering if there was a way to change colors of the text when you run it in command prompt(i.e. when a stock goes down turn red)
fred rosenberger
lowercase baba

Joined: Oct 02, 2003
Posts: 11923

there is (at least on XP) a color command. you could probably call it to change the colors. don't know a pure java way off the top of my head.

There are only two hard things in computer science: cache invalidation, naming things, and off-by-one errors
Consider Paul's rocket mass heater.
subject: Changing colors in Command Prompt
It's not a secret anymore!