• Post Reply Bookmark Topic Watch Topic
  • New Topic

Aligning record from Database on a textArea

 
Enock Banacson
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can anyone give some direction here, I am retrieving records from
Database and append them on the textarea, well they come fine but the problem is with the tabing "\t". I used one tabing for columns and records(columns data)
After 3 records under appropraite column fields have been appended, the next comming ones seems to double tab i.e. they leave more space in such a way that they end up lying under wrong column fields.
Thaks
 
Gregg Bolinger
Ranch Hand
Posts: 15304
6
Chrome IntelliJ IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Since you are appreantly not having any problems retrieving the data, but displaying it in a GUI, I am moving this to the Swing/AWT forum.
 
Wayne L Johnson
Ranch Hand
Posts: 399
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you really want the data to line up, why not use a "JTable"? That way you have re-sizable columns, you can control the display of different data types (String vs. int vs. date, etc.) and it will look much better.
If you do use a JTextArea then I'd suggest two things:
1) make sure to use a fixed-size font, and
2) use spaces rather than tabs to align everything.
But the "JTable" would look much better.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!