Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > JEditorPane (text/html) - determining position of caret in HTML source

Reply
Thread Tools

JEditorPane (text/html) - determining position of caret in HTML source

 
 
Robin
Guest
Posts: n/a
 
      05-12-2005
Hi,

I'm using a JEditorPane to display HTML.

I need to know if it's possible to exactly determine in the HTML source
the current caret position is.

i.e if the JEditorPane is displaying:
hello world

and the caret is at position 3 (between the 2 'l's in hello), how can I
find the corresponding position in the HTML source - in this case the
HTML source would be "<html><head></head><body>hello
world</body></html>", and the value I need is 28.

Many thanks,
Rob

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: Get the screen position for the caret in JEditorPane Stefan Istrate Java 0 04-16-2009 11:31 AM
Get the screen position for the caret in JEditorPane Stefan Istrate Java 1 04-16-2009 10:08 AM
advanced q?: mouseup position to caret position? brendan Javascript 0 08-29-2006 10:48 AM
How to get the exact caret position in the TextArea HTML control vasu Javascript 0 08-04-2005 06:51 AM
Current Caret Position =?Utf-8?B?SHVnaA==?= ASP .Net 1 02-05-2004 01:57 PM



Advertisments