| Author |
setting character width gap between characters in jtextpane
|
mark goking
Ranch Hand
Joined: Aug 18, 2009
Posts: 155
|
|
hi all, just wondering if it is possible to set a space character's width when painted in a jtextpane?
this is because i want to draw a fat symbol on the space character
|
Website/Java Games: http://www.chitgoks.com
Tech Blog: http://tech.chitgoks.com
|
 |
Darryl Burke
Bartender
Joined: May 03, 2008
Posts: 4167
|
|
If the JTextPane (not jtextpane) has a HTMLDocument, you can use & n b s p ; (without the spaces) along with one (or flanked by two) normal space characters.
edit The nbsp is parsed even within code tags?
|
luck, db
There are no new questions, but there may be new answers.
|
 |
mark goking
Ranch Hand
Joined: Aug 18, 2009
Posts: 155
|
|
no. i dont want that. i actually am going to draw/paint a symbol to replace the space
im guessing you have to customize the View but if there is a way to set a space character's width without creating a custom View, that is what i am looking for
|
 |
Campbell Ritchie
Sheriff
Joined: Oct 13, 2005
Posts: 32694
|
|
Darryl Burke wrote: . . . The nbsp is parsed even within code tags?
I tried it and I had it parsed inside code tags too.
|
 |
mark goking
Ranch Hand
Joined: Aug 18, 2009
Posts: 155
|
|
this is what im following
http://java-sl.com/showpar.html
however, the middle dot is so small. i want to replace it with a bigger symbol
|
 |
Rob Spoor
Sheriff
Joined: Oct 27, 2005
Posts: 19216
|
|
Simply escape the & with & when posting:  
|
SCJP 1.4 - SCJP 6 - SCWCD 5
How To Ask Questions How To Answer Questions
|
 |
Stanislav Lapitsky
Ranch Hand
Joined: Dec 01, 2009
Posts: 53
|
|
It's possible by custom GlyphPainter. See for example http://java-sl.com/gp_effects.html
You can use the same approach to enlarge space only.
|
 |
mark goking
Ranch Hand
Joined: Aug 18, 2009
Posts: 155
|
|
|
thanks. will check this
|
 |
 |
|
|
subject: setting character width gap between characters in jtextpane
|
|
|