[英]JTable Row-Editor
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
. 为任何行中的任何单元格选择编辑器,其中isCellEditable()
返回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
. 您可以将对表的TableModel
的引用和所需的行号传递给RowEditor
。 You'll have full access to the table model's methods, including getValueAt()
, setValueAt()
and getColumnClass()
methods. 您可以完全访问表模型的方法,包括getValueAt()
, setValueAt()
和getColumnClass()
方法。
If you want the entire row, with columns A, B, C edited in a new child window as 如果您想要整个行,则在新的子窗口中编辑A,B,C列
A ____
B ____
C ____
Then maybe you could make the row of some bean class Record, and use a java.beans.PropertyEditor to start with. 那么也许你可以创建一些bean类的行Record,并使用java.beans.PropertyEditor开始。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.