Cursor « JEditorPane « Java Swing Q&A





1. How can i find the tag at which my cursor points in JEditorPane    stackoverflow.com

I want to know whether we can find a tag in JEditorPane in java swing where my cursor is pointing.. For ex. following is the text content in my editor pane..

<html>
<head>
<body>
<div><!--Cursor inside the ...

2. how to place cursor at end of each line in JEditorPane    java-forums.org

Hi, I have a requirement that i want to place cursor at the end of the line,on which line i selected in JEditorPane.If each line contains 100 characters ,i just placed 50 characters.And i want to move the cursor to 100th character position of the same line.I tried with setCaretPosition but it shows BadPositionException.please help me. Thanks in advance, Prasad.