FlatLaf
FlatLaf copied to clipboard
'JTextField.selectAllOnFocusPolicy always' not working in tables
We have set UIManager.put("TextComponent.selectAllOnFocusPolicy", "always") for textfields. But this is not working when the component is the editor for a table-cell.
Yes, TextComponent.selectAllOnFocusPolicy
is disabled for cell editors since fixing #395 (in FlatLaf 1.6.2).
However, ATM I'm not sure whether the fix is ok.
There is some difference between commit message (mentions JTable.surrendersFocusOnKeystroke
)
and changed code (does not use JTable.surrendersFocusOnKeystroke
) 😕
I'll have a look...
fixed in commit 2972300112219c88bf600b8de4cb19538e0d1d9c
We have tried the new solution with UIManager.put("Table.editorSelectAllOnStartEditing", true), but is not working if you tabbed thru the cells or if the editor is an JFormattedTextField.
We have tried the new solution with UIManager.put("Table.editorSelectAllOnStartEditing", true),
This is not necessary because it is the default.
... but is not working if you tabbed thru the cells
How do you start editing?
... or if the editor is an JFormattedTextField.
Is the selectAll()
method invoked?
https://github.com/JFormDesigner/FlatLaf/blob/d26819d2684d21ea7b00c29a0e28e2e9a6799476/flatlaf-core/src/main/java/com/formdev/flatlaf/ui/FlatTableUI.java#L627-L628
Sorry for not mentioning this, we have extended JTable so that editing starts automatically for editable cells:
selectAll() for JFormattedTextField is invoked, but i seems only for the DisplayFormat, not for the EditFormat