public class DecimalCellEditor extends DefaultCellEditor
DecimalCellEditor
which is able to validate the entered value.
If the value is not valid the cell is marked with a red border and the value is rejected.
The cell value is right aligned.DefaultCellEditor.EditorDelegate
clickCountToStart, delegate, editorComponent
changeEvent, listenerList
Constructor and Description |
---|
DecimalCellEditor()
Creates a new editor.
|
DecimalCellEditor(double minValue,
double maxValue)
Creates a new editor.
|
Modifier and Type | Method and Description |
---|---|
Object |
getCellEditorValue() |
Component |
getTableCellEditorComponent(JTable table,
Object value,
boolean isSelected,
int row,
int column) |
boolean |
stopCellEditing() |
protected boolean |
validateValue(double value) |
cancelCellEditing, getClickCountToStart, getComponent, getTreeCellEditorComponent, isCellEditable, setClickCountToStart, shouldSelectCell
addCellEditorListener, fireEditingCanceled, fireEditingStopped, getCellEditorListeners, removeCellEditorListener
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
addCellEditorListener, removeCellEditorListener
public DecimalCellEditor()
Double.MIN_VALUE
and Double.MAX_VALUE
public DecimalCellEditor(double minValue, double maxValue)
minValue
and maxValue
minValue
- the minimum value of the valid rangemaxValue
- the maximum value of the valid rangepublic Component getTableCellEditorComponent(JTable table, Object value, boolean isSelected, int row, int column)
getTableCellEditorComponent
in interface TableCellEditor
getTableCellEditorComponent
in class DefaultCellEditor
public boolean stopCellEditing()
stopCellEditing
in interface CellEditor
stopCellEditing
in class DefaultCellEditor
protected boolean validateValue(double value)
public Object getCellEditorValue()
getCellEditorValue
in interface CellEditor
getCellEditorValue
in class DefaultCellEditor
Copyright © 2014–2015 European Space Agency (ESA). All rights reserved.