On Tue, 21 Dec 2021 21:01:32 GMT, Alexey Ivanov <aiva...@openjdk.org> wrote:

>>> No, they don't. At the same time `TableCellEditor` interface can't be used 
>>> to return a cell editor for `JComboBox` and for `JTree` components. These 
>>> components use `ComboBoxEditor` and `TreeCellEditor` correspondingly.
>> 
>> Right the TableCellEditor should not be used as a JComboBox/JTree editor, it 
>> is only for JTable. But the objects implemented TableCellEditor interface 
>> can be used to modify the values stored as the JComboBox/JTree when the user 
>> edits the cell of the table. So the user selects the cell -> the 
>> TableCellEditor is activated for editing that cell -> if the data for the 
>> cell may be stored as a list then the JComboBox could be shown -> the user 
>> may change/edit the current value of the cell using JComboBox and its 
>> values? And the list of components in the spec is just an example of what 
>> components can be used by the TableCellEditor.
>> 
>> At least this is how I read it, might be wrong.
>
> I agree it probably referred to components which can be used as an editor. 
> `DefaultEditorCell` supports three components: `JCheckBox`, `JComboBox`, and 
> `JTextField`.
> 
>> But the objects implemented TableCellEditor interface can be used to modify 
>> the values stored as the JComboBox/JTree when the user edits the cell of the 
>> table.
> 
> And this just adds to the confusion rather than clarifies the purpose of the 
> interface.

In fact, the `CellEditor` interface describes how the interface can be used for 
`JTable` and `JTree` and gives `JTextField`, `JCheckBox`, `JComboBox` as the 
examples of specific editors.

-------------

PR: https://git.openjdk.java.net/jdk/pull/6608

Reply via email to