Java is too limited when dealing with the Console

Roger Riggs Roger.Riggs at Oracle.com
Tue Nov 15 15:12:50 UTC 2016


Hi,

You might find an open source package like JLine would have the full 
featured terminal support you are looking for.
   http://jline.sourceforge.net/

Roger


On 11/13/2016 5:35 AM, Brunoais wrote:
> Since java 6, a class named Console was created. This class allows 
> reading and writing directly to the console, including getting input 
> without echoing for password purposes.
>
> Unfortunately, that class does not include useful functionality for 
> java programs to work on the console and output formatted text. The 
> feature I miss the most is knowing how many columns I have to type 
> into in order to deliver an easier to read formatted output while 
> avoiding line wraps that are not coded in.
>
> There are other things I miss like having multi-line progress bars (so 
> far I can do single line if it is the last line by using "\r" and 
> re-writing the line).
>
> Other times, it is more user friendly to wait for any key press 
> instead of specifically waiting for "Enter" which will also add more 
> lines to the console.
>
> I did some search and found nothing about this. Why hasn't this been 
> implemented for java code?
>



More information about the core-libs-dev mailing list