• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Aligning record from Database on a textArea

 
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Ranch Hand
Posts: 15304
6
Mac OS X IntelliJ IDE Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Ranch Hand
Posts: 399
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Destiny's powerful hand has made the bed of my future. And this tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic