Parag Saoji
Parag Saoji

Reputation: 97

Uneditable JTextField with cursor selection enabled

Is it possible to keep the JTextField uneditable, but keep the selection option using cursor enabled?

Upvotes: 0

Views: 198

Answers (1)

Hovercraft Full Of Eels
Hovercraft Full Of Eels

Reputation: 285405

Simply set editable to false via setEditable(...) The default for the focusable property is true so there will be no need to call setFocusable(...).

Upvotes: 2

Related Questions