I've found a weird problem that spins my head (daily story of my office life ). I want to use JEditorPane to show a simple HTML with monospace font. But the problem occurs when the bold tag encloses the & nbsp ;, the spacing seems not to be a fixed width anymore. Please try my code below :
When i run this on my eclipse, jdk1.4.2_15, linux suse 10.2, the line that is bold has different margin with the second line. It seems that the nbsp special character is not made monospaced if wrapped with bold tag. If the bold tag is removed, everything is fine.
At first, i thought this could be the font problem im using, so i changed in the source code from :
into this :
I think is what i want because Lucida Sans Typewriter is available in the JVM without additional font installation required. The result : The spacing width is allright, but instead of spaces, the line that is bold has small boxes instead.
Any ideas to solve this matter ?
Cheers, Albert Kam
[ February 19, 2008: Message edited by: Albert Kam ] [ February 19, 2008: Message edited by: Albert Kam ]
Be nice !
posted 12 years ago
Anyone tried out my code ? How's the output on your side ? Helpp
Be nice !
Water proof donuts! Eat them while reading this tiny ad: