Oh yes, I see the problem.
You could create a custom editor.
Paste this into the configureEditor and adjust as needed:
from javax.swing import AbstractCellEditor,JComboBox, JTextField
from javax.swing.table import TableCellEditor
class myTableCellEditor(TableCellEditor, AbstractCellEditor):
def __init__(self, tableComponent):
self.table= tableComponent
self.editor = None
def getTableCellEditorComponent(self, table, value, isSelected, rowIndex, vColIndex):
if rowIndex in [23, 25, 26]:
self.editor = JComboBox(["Line 1", "Line 2", "Line 3"])
else:
self.editor = JTextField()
return self.editor
def getCellEditorValue(self):
if type(self.editor) is JComboBox:
newValue = self.editor.getSelectedItem()
else:
newValue = self.editor.getText()
return newValue
if colName == "Vrednost":
m = myTableCellEditor(self)
return {"editor":m}
I got the idea from here: