public void actionPerformed(ActionEvent event) {
InputVerifier verifier = getInputVerifier();
if (! verifier.verify(DimensionTextField.this)) {
return;
}
LengthUnit unit = getUnit();
final double delta = (unit == LengthUnit.POINT) ? 1 : .1;
double dim = getDimension();
dim += delta;
if (dim >= 0) {
setDimension(dim);
}
}
};
ActionListener downAction = new ActionListener() {
public void actionPerformed(ActionEvent event) {
InputVerifier verifier = getInputVerifier();
if (! verifier.verify(DimensionTextField.this)) {
return;
}
LengthUnit unit = getUnit();
final double delta = (unit == LengthUnit.POINT) ? 1 : .1;
double dim = getDimension();
dim -= delta;
if (dim >= 0) {
setDimension(dim);