Skip to Main Content

Java SE (Java Platform, Standard Edition)

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Standard Widget Toolkit ( output on table/Text is different from console )

843807Feb 19 2008 — edited Apr 3 2008
First of all, i would like to apologize if the question regarding SWT isn't suppose to ask in this place.

I'm building my program using eclipse, swt is chose to be my GUI.

Problem :
String x = "A Tray of Ice Cubes" + "\n" + "WW and an ice cube ";

this string when output inside the 'console' , the both 'Ice' and 'ice' will be align at the same place like :

... Ice ...
... ice ...

but when i put the inside a table/Text then the 'ice' and 'Ice' will not be align at same place.

It's happen like that because each character width is not the same such as character " W " will take much more bigger width than ' a '.
I already trying to find inside google on how to set all the character/ ascii to be the same width, and i failed.

Anyone that has encountered this problem before and has solved it please help me.

Kar Hong.
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on May 1 2008
Added on Feb 19 2008
3 comments
131 views