0

Is it possible to have two (or more) independently scrolling columns in Java? I am asking for functionality like this:

Before:

Output 11    Output 21
Output 12    Output 22
Output 13    Output 23

After:

Another line was added to column 2, it scrolled up but left column 1 unaffected.

             Output 21
Output 11    Output 22
Output 12    Output 23
Output 13    Output 24

I am aware that such functionality could be achieved using Swing or an ncurses-like interface, but I am unable to use either.

EDIT: To clarify, I want to be able to format the stdout in this manner (or redirect it if necessary). The application I'm writing uses an interactive command line interface, this is why swing and curses are not acceptable. More specifically, I require Editline/Readline like functionality for the CLI. I can achieve this using a library called JLine. However I am not able to redirect JLine's input and output to use a text area in curses as opposed to the standard in/out. The same is true for Swing. Hence why I am trying to find a non-curses/swing bases solution.

I want to be able to display the normal output of the command-line interaction in one column, while displaying some more 'persistent' information in another.

diestl
  • 2,020
  • 4
  • 23
  • 37
  • I think you should clarify the constraints a bit better: are you looking for a solution that works in textmode or in windowed mode? And you state neither curses nor swing are acceptable, can you give a hint on what would be acceptable? – fvu Jul 23 '13 at 12:05
  • curses basically uniformizes and hides the low level API of your text terminal for you, and that's a good thing. maybe [have a look here](http://stackoverflow.com/questions/439799/whats-a-good-java-curses-like-library-for-terminal-applications) for curses-like text mode libs for Java? [lanterna](http://code.google.com/p/lanterna/) looks quite promising and is pure Java. – fvu Jul 23 '13 at 12:56
  • I have tried lanterna. See edit. – diestl Jul 26 '13 at 11:26

0 Answers0