I think the appropriate class is for displaying information on top of another component JPopupMenuthat already properly processes layering to display itself. JPopupMenu has a method show()that takes its "parent" component as an argument, and it will be displayed in this component coordinate space. Since you want to display a selection of terms for the user, select the appropriate menu.
To check for text changes, you must add DocumentListenerto the document that is wrapped JTextPane; You can access it using getDocument().
, ( , ), getCaretPosition(). int. modelToView() (x, y) . , , , .
addKeyListener(), JTextPane, , Ctrl - Space.
, , .