Asked  7 Months ago    Answers:  5   Viewed   32 times

I would like to write a Java terminal application that does screen manipulation. Are there any good libraries out there that allow you to manipulate the screen like curses in the *nix/C world?

Minimal features I'm looking for are windowing and user input support.

In feature-speak, I'd like to have a region of the terminal where some data is regularly updated while (at the same time) the user can enter commands/text in some other part of the screen.

 Answers

42

There is Charva, which links to native code but has an api based on Swing. The screenshots show lots of text windows, so that looks useful.

Tuesday, June 1, 2021
 
Precastic
answered 7 Months ago
27

If you were using JGraph, you should give a try to JGraphT which is designed for algorithms. One of its features is visualization using the JGraph library. It's still developed, but pretty stable. I analyzed the complexity of JGraphT algorithms some time ago. Some of them aren't the quickest, but if you're going to implement them on your own and need to display your graph, then it might be the best choice. I really liked using its API, when I quickly had to write an app that was working on graph and displaying it later.

Tuesday, June 1, 2021
 
simPod
answered 7 Months ago
21

Per default the system.in of your gradle build is not wired up with the system.in of the run (JavaExec) task. You can do the following:

// build.gradle (Groovy syntax)
run {
    standardInput = System.in
}

// build.gradle.kts (Kotlin syntax)
tasks.named<JavaExec>("run") {
    standardInput = System.`in`
}
Sunday, June 13, 2021
 
JustSteveKing
answered 6 Months ago
47

First when you write, don't use writeln(). Use write(). Second, you can use a "r" to Carriage Return without using n which is a New line. The carriage return should put you back at the beginning of the line.

Wednesday, June 16, 2021
 
drowneath
answered 6 Months ago
69

There is a wcurses. I've never tried it but it may meet your needs. It sounds like it doesn't have full curses compatibility, but may be close enough. Also it might not be using the DOS terminal, but opening a GUI window and drawing monospaced text inside.

Other windows text mode options are:

  • The console module;
  • wconio -- based on Borland's C conio library.

I believe both are windows only.

Wednesday, July 28, 2021
 
Domiik
answered 4 Months ago
Only authorized users can answer the question. Please sign in first, or register a free account.
Not the answer you're looking for? Browse other questions tagged :  
Share