![:hello: :hello:](./images/smilies/hello.gif)
![:hello: :hello:](./images/smilies/hello.gif)
Code: Alles auswählen
TableColumn sourceColumn = table.getColumnModel().getColumn(x);
...
JComboBox comboBox = new JComboBox(); comboBox.addItem("Channelxxxx");
...
sourceColumn.setCellEditor(new DefaultCellEditor(comboBox));
Code: Alles auswählen
final WholeNumberField integerField = new WholeNumberField(0,5);
integerField.setHorizontalAlignment(WholeNumberField.RIGHT);
DefaultCellEditor integerEditor = new DefaultCellEditor(integerField)
{
//Override DefaultCellEditor's getCellEditorValue method
//to return an Integer, not a String:
public Object getCellEditorValue()
{
return new Integer(integerField.getValue());
}
};
table.setDefaultEditor(Integer.class, integerEditor);