PDA

View Full Version : command text color


mikemrm
02-09-2010, 08:04 PM
im making a little program and im wanting the color of text to change when an error occurs so something like

what is your name? mom
ERROR: name must be atleast 3 characters

so when the error happens it turns either that specific text red or all text red i don't care just changing the color of the text is what i want

cs_student
02-09-2010, 09:56 PM
I don't believe this is possible when printing text to the command line interface. (unless your using some special third party library)
what is your name? mom
ERROR: name must be atleast 3 characters

Isn't mom 3 characters long. I think you want to print:
"ERROR: Name must be greater than three characters in length"

cs_student

mikemrm
02-10-2010, 07:24 PM
oh wow yea it should have been greater than 3 characters and i found a way to do it by running cmd commands to do color 4 or whatever but i think me searching how to run a cmd command in java put an alert up on our schools security and today the network administrator disable my cmd so now i cannot test my java code :(

cs_student
02-11-2010, 03:15 AM
In my ap computer science class last year I would just boot up linux via a flash drive so that I could do whatever I wanted. There are quite a few functional gui linux distros which will fit on a small flash drive.

brad211987
02-11-2010, 01:09 PM
You can probably also write your commands to compile and run your program in a windows batch file, and pipe the output to a text file.

mikemrm
02-12-2010, 06:57 PM
yea i tried to execute the class through a bat file but didnt get it to work then the bell rang, and now for some reason i have like no rights now so i like cannot do anything, i would open up linux but there servers detect any of those things, if the name of the computer isn't in there system you cannot join the network or do anything, and I would get in big trouble