• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

how to set these style constants in JTextPane?

 
arun mahajan
Ranch Hand
Posts: 305
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello Everybody,
I was trying to use JTextPane with the following StyleConstants:
1. LeftIndent
2. rightInent
3. FirstLineIndent
4. Alignemnt(center)
I was trying the following code but in vain. Can you please help me to achieve same?
regards,
Arun
Code:-
*********
 
arun mahajan
Ranch Hand
Posts: 305
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
Can somebody help me to achieve this. I hope I am not asking such a stupid question. Pl atleast reply for this post, evenif this is very basic question.
regards,
Arun
 
Nathan Pruett
Bartender
Posts: 4121
IntelliJ IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I got some of the indentation working by calling setLogicalStyle( Style ) on the JTextPane... I'll look for more documentation on how to set StyleConstants and post them...

-Nate
 
arun mahajan
Ranch Hand
Posts: 305
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am still waiting some help for this. I hope it is not so tedious or is it such a basic question?
I would be highly obliged if some one can provide me a code snippet or same.

regards,
Arun
 
Nathan Pruett
Bartender
Posts: 4121
IntelliJ IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Actually, I have found that there is a documented bug with the StyleConstants class... several of the constants have not been implemented, and thus don't affect the text. There's an article about it in the JDC on Sun's site, the bug and suggested fix are in Sun's bug database.

-Nate
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic