// Implement the one CellEditor method that AbstractCellEditor doesn't. @Override public Object getCellEditorValue() { int i = hexField.getValue(); if (i > 127) i -= 256; return new Byte((byte) i); }
// Implement the one method defined by TableCellEditor. @Override public Component getTableCellEditorComponent( JTable table, Object value, boolean isSelected, int row, int column) { hexField.setValue(((Byte) value).intValue()); return hexField; }
public HexEditor(int i) { hexField = new HexField(0, i); hexField.addActionListener(this); }