Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6134529
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T17:22:02+00:00 2026-05-23T17:22:02+00:00

I need to write a simple terminal-based program that should, Read some text from

  • 0

I need to write a simple terminal-based program that should,

  1. Read some text from a file using FileReader wrapped in BufferedReader.
  2. Print this text to console and a user should be able to modify it.
  3. Upon Enter + S, the program should read the modified text and save it back to the original file.

To sum up, the idea is to write a text editor for Unix-like environments with no GUI.

However, I have problems with steps 2 and 3.

  1. All the text that is printed by System.out is immutable. How can I change this behaviour?

  2. How do I implement a key listener for Enter + S. I can easily do it with GUI, but what do I add a listener to in a console-based program? And on Enter the program should simply add a new line to the modified text.
    Also, how can I read text that has already been printed to the terminal?

P.S. I have to use JDK 1.4 so no access to Scanner and Console classes if it is any relevant. I also think that such a task would be impossible to do in Java, so you could suggest a solution in C/C++ After all, they did it somehow back in MS-DOS era.

Thank you!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T17:22:03+00:00Added an answer on May 23, 2026 at 5:22 pm

    What you need is something like charva. It is a Java library that does what the old termcap / termio / curses / ncurses libraries did in the days of 24 x 80 terminals.

    Charva (and curses, etc) work by sending control codes and/or escape sequences to the terminal or terminal emulator to move the cursor around, write and erase characters and so on. On a modern system, they depend on the console providing ANSI or VT100 terminal emulation … or something like that.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I need to write a simple program that ask the user to insert 4
I need to write a 'simple' util to convert from ASCII to EBCDIC? The
I need to write a Delphi application that pulls entries up from various tables
I need to write code that picks up PGP-encrypted files from an FTP location
I am trying to write a simple program that lets me overlay a dot
The Problem I need to write a simple software that, giving certain constraints, appends
I need to write a simple method that gets a string as an input,
I need to write a simple Java GUI application that, basically, allows the user
I need write a program on Mac OS X to manage some number of
I need to write a program that will communicate with other .NET programs ...

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.