Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Tables in TerminalIO  RSS feed

 
Peter Shipway
Ranch Hand
Posts: 71
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Could somebody help me find an example of a program using tables in a text only java program? I know that I will have to import terminalIO as well as BrezzySwing to just the format.justify, but I just dont know how to atucally make the table, any help would be great thanks.
 
Dirk Schreckmann
Sheriff
Posts: 7023
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm not sure I understand your question.
Are you trying to find a utility (or an example to follow) that formats console text output into a table?
(Note that most folks probably aren't familiar with terminalIO and BrezzySwing, as these aren't parts of the standard Java API.)
 
Peter Shipway
Ranch Hand
Posts: 71
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Im trying to make a program that caculates interest and displays the results in a "table like format" in a text only program. example below
year interest
1 10.2
2 11
Total 21.2
 
Dirk Schreckmann
Sheriff
Posts: 7023
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think you're just going to have to do it the hard way.
You could count characters and fill with the appropriate number of spaces.
And/Or you could make use of a few tab characters.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!