Search code examples
gwtcursorcursor-position

GWT set cursor to a position (x,y)


in GWT, Is it possible to set the cursor position to a location (x,y) (top,left) ??


Solution

  • Are you referring to the mouse cursor? If so, browsers don't provide an API for setting the position of the mouse cursor.

    If you're talking about a text insertion caret in a TextArea or similar widget, you can use TextBoxBase.setCursorPos() to set the caret to a particular offset within the text.