Question

I have a multi-line paragraph displayed in a JEditorPane with certain words within them hyperlinked. I have custom HyperlinkListeners attached to these links that, among other things, returns the location of the cursor on the screen when they are clicked.

I want to get this information when the JEditorPanes are initialized, before the links are clicked. How might I go about doing this?

Was it helpful?

Solution

If you can find the words in the model then you can use:

Point p = editorPane.modelToView( ... );
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top