Skip to Main Content

New to Java

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!

how to justify text?

807597Jan 8 2005 — edited Jan 8 2005
The requirement from my teacher is, input a paragraph, do justify to the text, known as line wrap too. User will set the length of lines, known as the width of the text field.
For example, if i have a text:

Due to requests by our enterprise clients, EssentialBiz is now
offering Interactive Messaging Service (IMS) to clients who wish to
operate or run interactive SMS application using short codes. IMS is
a complete SMS gateway & interactive application solution for any
entity to offer interactive SMS services to their targeted audience.
The most popular interactive SMS services provided so far is in the
form of quiz based SMS contests (using our award winning QuizMaster
application) although we also offer customized application
development for any service that the clients want.

The output text should look like a perfect reactangle, meaning I have to make words on the right side line up perfectly. To do that, I will have to add some spaces in every line. But there are also cases where the length user set is smaller than the length of lines, then it's a more complicated case cuz i have to move the words.

Everyone understands what I'm saying here? If you find my words so confusing, feel free to ask me what I mean. Hope you will help me, many thanks first.
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Feb 5 2005
Added on Jan 8 2005
2 comments
214 views