Skeith
Skeith

Reputation: 2542

Possible ways to create console like screen in java

I am trying to create a screen like this one

enter image description here

Initially I was trying to port a console program to java. I have found things like jcurses and charva but there is almost no documentation on them and I really cant understand how to use them.

So I figured that I could create a console like screen that resembled the one above.

  1. what library / framwork would I be best using. Should I use swing as it if fully portable?

  2. what would be the best approach being that I need to be able to navigate and alter the 00 in the picture above?

Easily usable would be great but as long as it has good documentation that I can learn it from that would be fine.

Upvotes: 1

Views: 614

Answers (3)

user268396
user268396

Reputation: 11966

Unless you are looking to run the app on a headless VM (where a console/tty is all you've got), I'd use Swing. Create a JTable with a custom TableModel (to provide the data) and custom renderers (to provide the hex formatting) and everything should just work. Consider deriving from the various DefaultXXX implementations to save a lot of work.

Upvotes: 1

remipod
remipod

Reputation: 11699

If you prefer to create a full fledged GUI with Java you could certainly use Swing. I would prefer SWT as a matter of personal taste, the widget library of Eclipse. You will find a lot of snippets and tutorials (same for Swing). Here is the Widget Library.

Here is a discussion about SWT versus Swing.

You could use the table layout manager to create the layout shown in your screenshot. If you rewrite the application from scretch, you should be able to handle the GUI events and update the widgets according to your application needs. You will easily find articles when you search for swt and table. If you would like to keep the code base and just exchange the GUI, I 'm not sure about the best approach. Maybe, the libs jcurses and charva are the way to go.

Upvotes: 1

Dave Newton
Dave Newton

Reputation: 160170

(Answering as if you're looking for a hex editor.)

Played a bit with the fifesoft.com offering, kinda cool.

If you're not looking for a hex editor, can you be more specific? If you just want a cursor-addressable window you'll probably have to suck it up and figure out something like jcurses or libjcsi :)

Upvotes: 1

Related Questions