Win a copy of The Journey To Enterprise Agility this week in the Agile and Other Processes forum! And see the welcome thread for 20% off.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Jeanne Boyarsky
  • Liutauras Vilda
  • Campbell Ritchie
  • Tim Cooke
  • Bear Bibeault
Sheriffs:
  • Paul Clapham
  • Junilu Lacar
  • Knute Snortum
Saloon Keepers:
  • Ron McLeod
  • Ganesh Patekar
  • Tim Moores
  • Pete Letkeman
  • Stephan van Hulst
Bartenders:
  • Carey Brown
  • Tim Holloway
  • Joe Ess

Simple System.out question  RSS feed

 
author
Greenhorn
Posts: 23
5
  • 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,
 
Rancher
Posts: 42975
76
  • 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
author
Greenhorn
Posts: 23
5
  • 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!