I've a JTextPane that is used to show a text file. The text appears as follows
Line 1
Line 2
Line 3
What I want to get is the start index of the line where my caret is currently positioned. Is there a simple method in JTextPane that can help me achieve this?