This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Swing / AWT / SWT and the fly likes hoe to display text with 'justify' alignment..? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "hoe to display text with Watch "hoe to display text with New topic
Author

hoe to display text with 'justify' alignment..?

shahabas shabeer
Ranch Hand

Joined: Feb 23, 2004
Posts: 49
Hi friends,
I want to display some text with 'justify' alignment (the alignment obtained using align='justify' in html ). Can anybody tell me how can I do this and the component that I should use..?. If possible, please provide code samples.

Thanks
Shahabas E Shabeer


The greatest pleasure in life is doing what peoples say you can not do.
Nigel Browne
Ranch Hand

Joined: May 15, 2001
Posts: 673
Read the following tutorial Using HTML in Swing Components
shahabas shabeer
Ranch Hand

Joined: Feb 23, 2004
Posts: 49
Thanks for your reply..
I am sorry, my question was not clear.
Actually I want to display a BLOCK of text (say a paragraph) with 'justify' alignment. I tried HTML formatting. But unfortunately it is not working. When used with JLabel,JTextPane and JEditorPane, the result of align='center' and align='justify' are the same.
I want the paragraph to be displayed with equal margins on both the left
and right side of page.Is this possible.?

Thanks
Shahabas E Shabeer
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: hoe to display text with 'justify' alignment..?
 
Similar Threads
problem with header text alignment
Is Java's alignment "Justify" is same as MS Word's alignment "Justify"?
inputText with vertical alignment with label
setting text alignment in a TextField
Flipping an image before displaying it