Terminal app

Discussion in 'Java' started by mnml, Nov 23, 2007.

  1. mnml

    mnml Guest

    Hi,
    I am trying to code a terminal application. I would like to know if
    there is "something" I can use from the java Api to avoid redrawing
    all the characters on the screen.
    thanks
    mnml, Nov 23, 2007
    #1
    1. Advertising

  2. On Fri, 23 Nov 2007 02:45:26 -0800 (PST), mnml wrote:
    > I am trying to code a terminal application. I would like to know if
    > there is "something" I can use from the java Api to avoid redrawing
    > all the characters on the screen.


    Most terminal applications never need to redraw the whole screen or
    even parts of it. Maybe you had something more advanced in mind than a
    line-based application?

    From an old post, no idea of their status:

    http://www.bmsi.com/tuipeer/
    http://sourceforge.net/projects/javacurses/
    http://www.pitman.co.za/projects/charva/index.html
    http://java-readline.sourceforge.net/

    /gordon

    --
    Gordon Beaton, Nov 23, 2007
    #2
    1. Advertising

  3. mnml

    Nigel Wade Guest

    mnml wrote:

    >
    > Hi,
    > I am trying to code a terminal application. I would like to know if
    > there is "something" I can use from the java Api to avoid redrawing
    > all the characters on the screen.
    > thanks


    T

    I have no idea if this is the sort of thing you are looking for, but have a look
    for yourself:
    http://sourceforge.net/projects/javacurses

    I have never use the above, but I have in the past used the UNIX curses library
    which is/was a library for addressing text based terminals/consoles in a
    "graphical" way.

    --
    Nigel Wade, System Administrator, Space Plasma Physics Group,
    University of Leicester, Leicester, LE1 7RH, UK
    E-mail :
    Phone : +44 (0)116 2523548, Fax : +44 (0)116 2523555
    Nigel Wade, Nov 23, 2007
    #3
  4. mnml

    mnml Guest

    On Nov 23, 11:30 am, Gordon Beaton <> wrote:
    > On Fri, 23 Nov 2007 02:45:26 -0800 (PST), mnml wrote:
    > > I am trying to code a terminal application. I would like to know if
    > > there is "something" I can use from the java Api to avoid redrawing
    > > all the characters on the screen.

    >
    > Most terminal applications never need to redraw the whole screen or
    > even parts of it. Maybe you had something more advanced in mind than a
    > line-based application?
    >
    > From an old post, no idea of their status:
    >
    > http://www.bmsi.com/tuipeer/
    > http://sourceforge.net/projects/javacurses/
    > http://www.pitman.co.za/projects/charva/index.html
    > http://java-readline.sourceforge.net/
    >
    > /gordon
    >
    > --


    thanks for the links, yes it need to redraw the whole screen (it's a
    game), I wondering if it's possible to do that without any external
    libs.
    mnml, Nov 23, 2007
    #4
  5. Nigel Wade wrote:
    > mnml wrote:
    >
    >> Hi,
    >> I am trying to code a terminal application. I would like to know if
    >> there is "something" I can use from the java Api to avoid redrawing
    >> all the characters on the screen.
    >> thanks

    >
    > T
    >
    > I have no idea if this is the sort of thing you are looking for, but have a look
    > for yourself:
    > http://sourceforge.net/projects/javacurses
    >
    > I have never use the above, but I have in the past used the UNIX curses library
    > which is/was a library for addressing text based terminals/consoles in a
    > "graphical" way.
    >

    This may not be what the OP wants. I just downloaded it to take a look.
    There is almost no documentation apart from Javadocs output from the
    classes, i.e. no really explanatory overview and no example code. It
    looks to me as it if its meant to be an exact analogue of the C curses
    library, allowing a Java program to handle screens and forms on a
    console screen rather than painting it inside an AWT or Swing window.

    To the OP: from this description is this what you want or are you
    looking for code that emulates a text terminal within a Swing JPanel?

    If the latter, I wrote a Java glass teletype emulation that was capable
    of keeping up with my typing and with data coming in on a 9600 baud
    serial connection. It could handle a remote interactive login session
    with no noticeable delays when run on a 300 MHz PII box. I used an 80 x
    25 JTextArea to represent the screen and handled writing to it by
    manipulating the text content of the JTextArea.


    --
    martin@ | Martin Gregorie
    gregorie. | Essex, UK
    org |
    Martin Gregorie, Nov 23, 2007
    #5
  6. mnml

    Nigel Wade Guest

    Martin Gregorie wrote:

    > Nigel Wade wrote:
    >> mnml wrote:
    >>
    >>> Hi,
    >>> I am trying to code a terminal application. I would like to know if
    >>> there is "something" I can use from the java Api to avoid redrawing
    >>> all the characters on the screen.
    >>> thanks

    >>
    >> T
    >>
    >> I have no idea if this is the sort of thing you are looking for, but have a

    look
    >> for yourself:
    >> http://sourceforge.net/projects/javacurses
    >>
    >> I have never use the above, but I have in the past used the UNIX curses

    library
    >> which is/was a library for addressing text based terminals/consoles in a
    >> "graphical" way.
    >>

    > This may not be what the OP wants. I just downloaded it to take a look.
    > There is almost no documentation apart from Javadocs output from the
    > classes, i.e. no really explanatory overview and no example code. It
    > looks to me as it if its meant to be an exact analogue of the C curses
    > library, allowing a Java program to handle screens and forms on a
    > console screen rather than painting it inside an AWT or Swing window.
    >


    I assumed from what the OP said that "terminal application" was an application
    running within a terminal, and "redrawing all the characters on the screen" is
    exactly what curses did for you.

    The description in the original post was limited, so we have to fill in the gaps
    and guess what was intended. Because of that I didn't download any info on the
    package, I left that as an exercise for the OP...

    --
    Nigel Wade, System Administrator, Space Plasma Physics Group,
    University of Leicester, Leicester, LE1 7RH, UK
    E-mail :
    Phone : +44 (0)116 2523548, Fax : +44 (0)116 2523555
    Nigel Wade, Nov 23, 2007
    #6
  7. mnml

    Jeff Higgins Guest

    mnml wrote:
    > thanks for the links, yes it need to redraw the whole screen (it's a
    > game), I wondering if it's possible to do that without any external
    > libs.


    Have you looked into using the Full-Screen Exclusive Mode API?

    <http://java.sun.com/docs/books/tutorial/extra/fullscreen/index.html>
    Jeff Higgins, Nov 23, 2007
    #7
  8. Nigel Wade wrote:
    > Martin Gregorie wrote:
    >
    >> Nigel Wade wrote:
    >>> mnml wrote:
    >>>
    >>>> Hi,
    >>>> I am trying to code a terminal application. I would like to know if
    >>>> there is "something" I can use from the java Api to avoid redrawing
    >>>> all the characters on the screen.
    >>>> thanks
    >>> T
    >>>
    >>> I have no idea if this is the sort of thing you are looking for, but have a

    > look
    >>> for yourself:
    >>> http://sourceforge.net/projects/javacurses
    >>>
    >>> I have never use the above, but I have in the past used the UNIX curses

    > library
    >>> which is/was a library for addressing text based terminals/consoles in a
    >>> "graphical" way.
    >>>

    >> This may not be what the OP wants. I just downloaded it to take a look.
    >> There is almost no documentation apart from Javadocs output from the
    >> classes, i.e. no really explanatory overview and no example code. It
    >> looks to me as it if its meant to be an exact analogue of the C curses
    >> library, allowing a Java program to handle screens and forms on a
    >> console screen rather than painting it inside an AWT or Swing window.
    >>

    >
    > I assumed from what the OP said that "terminal application" was an application
    > running within a terminal, and "redrawing all the characters on the screen" is
    > exactly what curses did for you.
    >
    > The description in the original post was limited, so we have to fill in the gaps
    > and guess what was intended. Because of that I didn't download any info on the
    > package, I left that as an exercise for the OP...
    >

    I took a look because, if it would do things like emulating a VT-100,
    xterm or wyse-120 terminal inside a GUI window, I may well have a use
    for it. But I don't think it will do that.

    Instead, it looks as if its targeted on allowing Java to do curses-type
    things without needing a GUI interface (i.e. you could use it in a DOS
    box, Linux or X-term console, or even on a physical character-mode
    terminal (VT-100, Wyse-120 etc.).

    However, it if can read, parse and interpret a termcap definition I can
    at least swipe some code from it to glue on the back of my JTextArea
    screen emulation. At some point I know I'll need an application that
    emulates a terminal while using a socket connection to talk to some
    emulated hardware running an OS that thinks its using a serial port.


    --
    martin@ | Martin Gregorie
    gregorie. | Essex, UK
    org |
    Martin Gregorie, Nov 23, 2007
    #8
  9. Martin Gregorie wrote:

    <snip discussion of java curses library etc>

    > I took a look because, if it would do things like emulating a VT-100,
    > xterm or wyse-120 terminal inside a GUI window, I may well have a use
    > for it. But I don't think it will do that.
    >
    > Instead, it looks as if its targeted on allowing Java to do curses-type
    > things without needing a GUI interface (i.e. you could use it in a DOS
    > box, Linux or X-term console, or even on a physical character-mode
    > terminal (VT-100, Wyse-120 etc.).
    >
    > However, it if can read, parse and interpret a termcap definition I can
    > at least swipe some code from it to glue on the back of my JTextArea
    > screen emulation. At some point I know I'll need an application that
    > emulates a terminal while using a socket connection to talk to some
    > emulated hardware running an OS that thinks its using a serial port.
    >
    >


    JTA is a Java applet that emulates an ANSI terminal. I believe the API
    can be used for other applications too.

    http://javassh.org/space/Docs and Tutorials
    RedGrittyBrick, Nov 26, 2007
    #9
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. John
    Replies:
    2
    Views:
    720
    Thomas Weidenfeller
    May 19, 2005
  2. Sells, Fred
    Replies:
    0
    Views:
    246
    Sells, Fred
    Jul 3, 2007
  3. gaurav kashyap
    Replies:
    3
    Views:
    6,647
    Paul Boddie
    Oct 31, 2008
  4. Steve
    Replies:
    2
    Views:
    932
    edicionsdigitals.com edicions digitals xarxa socia
    Dec 7, 2010
  5. Victor Martin
    Replies:
    3
    Views:
    120
    Victor Martin
    May 22, 2009
Loading...

Share This Page