5

I am looking for a component I can use in Swing that acts as a GUI console which

  • has a text area with scrollbars that can be set to a particular font
  • has an InputStream and an OutputStream that a host application can obtain
  • accepts keyboard input, prints it onto the end of the console text, and sends that input to the InputStream
  • prints the OutputStream text to the end of the console
  • has some kind of FIFO-ish property whereby the amount of text displayed in the console can be limited by automatically discarding the oldest text, when appropriate
  • allows copy (but not cut or paste or any other editing) of the console text to the system clipboard

This is kind of like the Console tab in Eclipse.

Are there any good libraries that provide this?

Jason S
  • 184,598
  • 164
  • 608
  • 970
  • possible duplicate of [Looking for an efficient Java Swing based console](http://stackoverflow.com/questions/2329455/looking-for-an-efficient-java-swing-based-console) – Paul Tomblin May 10 '10 at 20:03
  • Not a duplicate; I don't care about colors + scroll locks and such, and JTextArea doesn't give you input/output streams. – Jason S May 11 '10 at 01:12
  • Would this help? http://stackoverflow.com/questions/1255373/create-a-command-console – krishnakumarp Apr 25 '12 at 11:42

2 Answers2

5

Does this suffice?

Bozho
  • 588,226
  • 146
  • 1,060
  • 1,140
  • 1
    Ick. No, it's only a lightweight 5kbyte extension of JTextPane that implements colors + such in a way that could be used as a VT100-type terminal. (sorry for the timelag, some of my Java work follows a very bursty schedule) – Jason S Apr 06 '11 at 19:31
1

Here is an in-development open source library that does most of what is needed for a console:

mikera
  • 105,238
  • 25
  • 256
  • 415
  • 2
    This does not seem to expose the InputStream from which one can read user input to the console – xorcus Jan 18 '15 at 08:17