Matt Gerrans
Posts: 1153
Nickname: matt
Registered: Feb, 2002
|
|
Re: GUI help needed
|
Posted: Apr 5, 2002 12:34 AM
|
|
I would strongly disagree with the approach of stuffing space characters into the TextArea in order to align columns.
First of all, you are not likely to get good alignment unless you use a fixed-width font. You may get things almost aligned, but it will probably look a bit cheesy and be very much dependent upon the font.
Second, you are polluting your data. If you want to allow editing, it will be a big mess to maintain on many fronts. Imagine someone typing new characters into an item in the first column; you have to keep adjusting the number of padding space characters. What happens when they type in enough characters to make the current row's first column wider than the current widest column in some other row? Now you have to go and re-pad all the rows. This will be visually jarring, at best, and the data quickly becomes an unmanageable amorphous blob of characters (kind of like a chess tournament!). Additionally, if you copy and paste this data to some other window that has a different font, the results rarely be satisfying.
With your data in a table format, you maintain the data's integrity, allow for easy editing and copying. On top of that, it probably will look much nicer and more professional. You will also learn how to use a nifty new component instead of trying to shoehorn everything you do into simple text components.
Since it is great to have choices, another choice that is better than using a TextArea or TextField with space padding is simply drawing the text on the Pane -- then you can have perfect alignment. However, editing and copying will be a lot of work, so this is really only good if you don't want it to be edited or copied.
|
|