Go Back   CodingForums.com > :: Server side development > Java and JSP

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 02-09-2010, 08:04 PM   PM User | #1
mikemrm
New Coder

 
Join Date: Mar 2009
Location: Texas
Posts: 23
Thanks: 1
Thanked 0 Times in 0 Posts
mikemrm is an unknown quantity at this point
command text color

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
mikemrm is offline   Reply With Quote
Old 02-09-2010, 09:56 PM   PM User | #2
cs_student
Regular Coder

 
cs_student's Avatar
 
Join Date: Oct 2009
Location: ~/
Posts: 195
Thanks: 2
Thanked 22 Times in 22 Posts
cs_student is an unknown quantity at this point
I don't believe this is possible when printing text to the command line interface. (unless your using some special third party library)
Quote:
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
__________________
Get GNU/Linux - Play Ogg - Vim
Using Arch Linux x86_64, Xorg + xmonad
cs_student is offline   Reply With Quote
Old 02-10-2010, 07:24 PM   PM User | #3
mikemrm
New Coder

 
Join Date: Mar 2009
Location: Texas
Posts: 23
Thanks: 1
Thanked 0 Times in 0 Posts
mikemrm is an unknown quantity at this point
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
mikemrm is offline   Reply With Quote
Old 02-11-2010, 03:15 AM   PM User | #4
cs_student
Regular Coder

 
cs_student's Avatar
 
Join Date: Oct 2009
Location: ~/
Posts: 195
Thanks: 2
Thanked 22 Times in 22 Posts
cs_student is an unknown quantity at this point
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.
__________________
Get GNU/Linux - Play Ogg - Vim
Using Arch Linux x86_64, Xorg + xmonad
cs_student is offline   Reply With Quote
Old 02-11-2010, 01:09 PM   PM User | #5
brad211987
Regular Coder

 
brad211987's Avatar
 
Join Date: Sep 2005
Location: Ohio
Posts: 631
Thanks: 10
Thanked 50 Times in 50 Posts
brad211987 is an unknown quantity at this point
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.
brad211987 is offline   Reply With Quote
Old 02-12-2010, 06:57 PM   PM User | #6
mikemrm
New Coder

 
Join Date: Mar 2009
Location: Texas
Posts: 23
Thanks: 1
Thanked 0 Times in 0 Posts
mikemrm is an unknown quantity at this point
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
mikemrm is offline   Reply With Quote
Reply

Bookmarks

Tags
cmd, color, text

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 01:43 AM.


Advertisement
Log in to turn off these ads.