Interface CalculatorBox.RangeCheck

  • Enclosing class:
    CalculatorBox

    public static interface CalculatorBox.RangeCheck
    Implement this interface to check if the given value is a valid value to be returned. Return null if the value is correct, or a message that will be displayed to the user if not. Note that the range check only occurs when the user do NOT press Cancel.
      Edit ed = new Edit();
      ed.rangeCheck = new CalculatorBox.RangeCheck()
      {
         public String check(double value)
         {
            if (value > 0 && value < 10)
               return null;
            return "The value must be between 0 and 10";
         }
      };
      ed.setMode(Edit.CURRENCY,true);
      add(ed,LEFT,TOP);
     
    Since:
    TotalCross 2.0
    • Method Detail

      • check

        java.lang.String check​(double value)