I am using JTextPane and in that textpane I have certain paragraphs. If I select certain words on a line and change the font then the cursor height automatically increases. Now I press the right arrow key to move the cursor towards right. When the cursor is on a font of smaller size then the height of the cursor should also decrease accordingly. But this is not happening. The height of cursor remains the same which it got for the bigger font I had set. So my problem is how to change the height of cursor when it is traversing on text having different font.