On Mon, 6 Dec 2021 19:00:32 GMT, Alexey Ivanov <[email protected]> wrote:
>> I'm not sure this fix is going in the right direction. Isn't the doc saying >> that if you want to use one of these components as the cell of a JTable it >> should implement this interface ? >> And the problem with JListBox is that it is actually just called JList ? > > As I read it, the interface `TableCellEditor` adds the > `getTableCellEditorComponent` method to the generic `CellEditor` interface. > > There's also `TreeCellEditor` interface which adds > `getTreeCellEditorComponent` specifically for `JTree`. This one has a cleaner > [Javadoc](https://docs.oracle.com/en/java/javase/17/docs/api/java.desktop/javax/swing/tree/TreeCellEditor.html): > >> Adds to CellEditor the extensions necessary to configure an editor in a tree. > > The `TableCellEditor` interface should say something similar. Currently, the Javadoc says, “…that would like to be an editor of values _for components_ such as JListBox, JComboBox, JTree, or JTable…” Yet the interface adds a method which is relevant for `JTable` only. `JList` has no cell editor. `JComboBox` uses its own `ComboBoxEditor` interface, and `JTree` uses `TreeCellEditor`. So, I think we're in the right direction. ------------- PR: https://git.openjdk.java.net/jdk/pull/6608
