Пример #1
0
  public double getDouble() {
    String double_str = null;
    if (self_listener != null) double_str = self_listener.getLastUpdatedText();
    else double_str = fld.getText();

    try {
      return fmt.parse(double_str).doubleValue();
    } catch (ParseException perr) {
      perr.printStackTrace();
      return Double.MIN_VALUE;
    }
  }
Пример #2
0
  public float getFloat() {
    String float_str = null;
    if (self_listener != null) float_str = self_listener.getLastUpdatedText();
    else float_str = fld.getText();

    try {
      return fmt.parse(float_str).floatValue();
    } catch (ParseException perr) {
      perr.printStackTrace();
      return Float.MIN_VALUE;
    }
  }
Пример #3
0
  public int getInteger() {
    String int_str = null;
    if (self_listener != null) int_str = self_listener.getLastUpdatedText();
    else int_str = fld.getText();

    try {
      return fmt.parse(int_str).intValue();
    } catch (ParseException perr) {
      perr.printStackTrace();
      return Integer.MIN_VALUE;
    }
  }
Пример #4
0
  public short getShort() {
    String short_str = null;
    if (self_listener != null) short_str = self_listener.getLastUpdatedText();
    else short_str = fld.getText();

    try {
      return fmt.parse(short_str).shortValue();
    } catch (ParseException perr) {
      perr.printStackTrace();
      return Short.MIN_VALUE;
    }
  }
Пример #5
0
 public boolean getBoolean() {
   String bool_str = null;
   if (self_listener != null) bool_str = self_listener.getLastUpdatedText();
   else bool_str = fld.getText();
   return bool_str.equalsIgnoreCase("true") || bool_str.equalsIgnoreCase("yes");
 }
Пример #6
0
 public String getText() {
   if (self_listener != null) return self_listener.getLastUpdatedText();
   else return fld.getText();
 }