Vincent Roye
Vincent Roye

Reputation: 2851

How to put the type cursor automatically in a JEditorPane?

After a card panel switch I would like to automatically put the type cursor in a JEditorPane located in my new displayed card. How can I do that?

Upvotes: 0

Views: 102

Answers (2)

Andrew Thompson
Andrew Thompson

Reputation: 168845

editorPane.requestFocusInWindow();

Upvotes: 4

camickr
camickr

Reputation: 324157

I think you are asking to place focus on the editor pane when you switch cards when using a CardLayout. If so, then check out Card Layout Focus for one approach.

Upvotes: 2

Related Questions