Re: Editor / Renderer: data flow



"Denis" <denis.mazzucato@xxxxxxxxx> wrote in news:1140695584.873035.240170
@f14g2000cwb.googlegroups.com:

Hi all.

When I set an editor and a renderer to a jtable, which is the data
flow?

My editor return an Object from getCellEditorValue method. And then?
Which method proces that object?

I ask this cause I've set an editor with a comboBox to a jxtreetable
and when I click I see the comboBox. But when I select a value the
comboBox disappear and the cell remains as before...

Please help!

Thanks all,
DM



When the editor stops or cancels editing (fireEditingStopped or
fireEditingCanceled), the renderer takes over again. Or, more accurately,
every cell is rendered by the renderer, and the editor only pops up when a
cell is being edited, and only for that duration. If I understand
correctly, in your case you get the combobox editor when you click the
cell. Then, when you select a value from the combobox, that value is set
in the table's model, and the (default?) renderer renders it. Since the
renderer is not a combobox, the combobox disappears from the screen,
because editing has finished (stopped). The same thing happens when
editing is cancelled (typically if the combobox loses focus or you cancel
with escape), only then the original value remains.

Does this answer your question?
.



Relevant Pages

  • JTable, CellEditors and terminateEditOnFocusLost
    ... editing a cell of the table and then clicks on another cell to edit ... - the editor of the new cell is loaded ... Without "terminateEditOnFocusLost" the behaviour is also strange: ... but on a custom ComboBox editor the combobox ...
    (comp.lang.java.gui)
  • Re: Controlling JComboBox size in JTable cell
    ... I have a JTable where each cell is huge. ... public Component prepareEditor(TableCellEditor editor, int r, int c) returns your combobox. ...
    (comp.lang.java.gui)
  • Swing - JTable, CellEditors and terminateEditOnFocusLost
    ... "terminateEditOnFocusLost" property to have editors get removed ... user is editing a cell of the table and then clicks on another cell to ... - the editor of the new cell is loaded ... but on a custom ComboBox editor the combobox ...
    (comp.lang.java.programmer)
  • Swing - JTable, CellEditors and terminateEditOnFocusLost
    ... "terminateEditOnFocusLost" property to have editors get removed ... user is editing a cell of the table and then clicks on another cell to ... - the editor of the new cell is loaded ... but on a custom ComboBox editor the combobox ...
    (comp.lang.java.programmer)
  • Re: Swing - JTable, CellEditors and terminateEditOnFocusLost
    ... > "terminateEditOnFocusLost" property to have editors get removed ... > user is editing a cell of the table and then clicks on another cell to ... > - the editor of the new cell is loaded ... but on a custom ComboBox editor the combobox ...
    (comp.lang.java.programmer)