JTable Row-Editor

I'm searching for an editor like in this example; I mean the "Pick a Color"-Frame, but for the whole row. Is it my issue to fully implement this, or can I expand some exsiting editors?

Upvotes: 1

Views: 690

Answers (2)

trashgod
trashgod

Reputation: 205875

The default renderers and editors for common column data types are shown here. An editor is chosen for any cell in any row for which isCellEditable() returns true. You can also specify a custom renderer and editor, such as the color chooser you cited. Two recent examples are seen here, but the details depend on your use-case.

Addendum: something like an child window

You can pass a reference to the table's TableModel and the desired row number to your RowEditor. You'll have full access to the table model's methods, including getValueAt(), setValueAt() and getColumnClass() methods.

Upvotes: 2

Joop Eggen
Joop Eggen

Reputation: 109613

If you want the entire row, with columns A, B, C edited in a new child window as

A  ____
B  ____
C  ____

Then maybe you could make the row of some bean class Record, and use a java.beans.PropertyEditor to start with.

Upvotes: 2

Related Questions