Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Possible clash: 'TextComponent.selectAllOnFocusPolicy' and enabled 'surrendersFocusOnKeystroke' on JTable? #395

Closed
tristanzhou opened this issue Oct 14, 2021 · 2 comments
Milestone

Comments

@tristanzhou
Copy link

Hi,

The JTextField cell editor normally won't get the focused event if you type directly on a cell (without a mouse click into the cell editor). So the 'TextComponent.selectAllOnFocusPolicy' won't apply to cell editors. But when you enable the 'surrendersFocusOnKeystroke' on the JTable. The cell editor will get the focus, then the text you typed into the cell directly will be selected (if 'TextComponent.selectAllOnFocusPolicy': once or always). If you set the policy to 'once', it only applies to the first cell editor in the table. It makes people feel strange.

So is it possible to disable this policy for cell editors? Especially when 'surrendersFocusOnKeystroke' is enabled.

Thanks,
Tristan

DevCharly added a commit that referenced this issue Oct 16, 2021
…able.surrendersFocusOnKeystroke` is `true`) and `TextComponent.selectAllOnFocusPolicy` is `once` (the default) or `always` (issue #395)
@DevCharly
Copy link
Collaborator

Many thanks for reporting this.
I've fixed it in main branch.

@DevCharly DevCharly added this to the 2.0 milestone Oct 16, 2021
DevCharly added a commit that referenced this issue Nov 11, 2021
…able.surrendersFocusOnKeystroke` is `true`) and `TextComponent.selectAllOnFocusPolicy` is `once` (the default) or `always` (issue #395)

(cherry picked from commit f8b9f4c)
@DevCharly
Copy link
Collaborator

Fixed in 1.6.2.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants