• Post Reply Bookmark Topic Watch Topic
  • New Topic

Simple System.out question

 
T Weston
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Folks,

I just had a question about writing to System.out / the console and wondered if anyone could help...

I'd like to do two things really,

1. write a single line on the console (like using System.out.print()), then
reset/clear that line and write again. Having the ability to set the cursor position - that kind of thing.

2. Understand what characters I can write, I'm assuming I can write ASCII to all target machines but is it possible to create font-like characters using standard output - I'm guessing not as that feels like I'd have to have access to pixcels (use a Panel etc)?

Any tips would be great, I found http://www.rgagnon.com/javadetails/java-0047.html which also mentioned using JNI... is that my only hope?! I'm hoping for a platform independant mechanism...

Thanks all,
 
Ulf Dittmer
Rancher
Posts: 42970
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to JavaRanch.

You shouldn't assume that anything but ASCII will be displayed correctly - there are many shells/consoles out there that can't interpret anything else.

I'm not sure about "editing" the console output from within Java, but a library like jLine may give you a head start.
[ April 19, 2006: Message edited by: Ulf Dittmer ]
 
T Weston
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Excellent, thanks, I'll look into jLine right now...
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!