Tab is behaving as a space char for right and center alignment in JTextPane
843806May 26 2009 — edited May 28 2009Hi 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 systems 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.