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!

Tab is behaving as a space char for right and center alignment in JTextPane

843806May 26 2009 — edited May 28 2009
Hi All,

When I am entering the Tab space by pressing tab button on keyboard, only a single space is getting inserted if the alignment is set to right or center inside JTextPane. In case of left alignment, the tab character is added correctly i.e. the spaces are inserted correctly based on the system’s tab settings.

If I keep left alignment initially, then enter some text by including few tab characters in between that text and then change the alignment to right or center, the tab spaces are getting replaced with a single space character.

The tab character should behave uniformly for all types of alignments. It should not be changed/replaced by a single space character on changing the alignments.

Can anybody help me out to solve this issue? Or inform whether is it the default behavior of tab character for center and right alignment settings inside JTextPane ?

Thanks in advance.
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jun 25 2009
Added on May 26 2009
10 comments
419 views