Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Stream of special Charset?..  RSS feed

 
Nik lammar
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello javaranchers,
In my simpleserver, i use printwriter class to transmit characters on clients.my problem is:
I wanna use color.My clients uses telnet.How can i send them stream's of data (words) that will hava a specific color?
For example pascal (old-scool is here ) over 6th version, gives you the chance to print a stream (or a string whatever) on command line based applications with color...
How can I do that on java?

how can i print the message "hello world" on commandline based application or on a telnet client (using Ansi charset maybe...)

Please, i wanna do that for my excersize on univ.. and 2 weeks ago I'm stuck on this.

Thanks in advice and for your help, if any!
 
Joe Ess
Bartender
Posts: 9406
12
Linux Mac OS X Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Java doesn't have strong console control methods. There's a couple of reasons for this. First and foremost, if you are creating an interactive GUI, the easiest and most consistent way to do it is to use the AWT and Swing classes. Character-based GUI's are usually cumbersome and counter-intuitive for the user and tedious to write for the programmer.
Second, Java is cross-platform. You have CMD shell on Windows, Bash, Korn and other shells on Unix, and some platforms, like PDA's and cell phones, that don't have command shells.
That said, I've seen people post here that they've had some success using ANSI control characters. Search this forum and you'll find a couple of relevant topics. Again, because shells are different, your results will vary depending on your platform.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!