Examples of stringToValue()


Examples of javax.swing.text.MaskFormatter.stringToValue()

    String m = this.getMask();
    if(v != null && m != null) {
      try {
        MaskFormatter mf = new MaskFormatter(m);
        mf.setValueContainsLiteralCharacters(false);
        unmaskedValue = (String) mf.stringToValue(v);
        if(unmaskedValue != null) {
          // MaskFormatter leaves extra white space if it's too short, not good
          // for our purposes
          unmaskedValue = unmaskedValue.trim();
        }
View Full Code Here

Examples of javax.swing.text.MaskFormatter.stringToValue()

  public String limpar(String valor, String mascara) {
    try {
      if (valor.length() == mascara.length()) {
        MaskFormatter formatter = new MaskFormatter(mascara);
        formatter.setValueContainsLiteralCharacters(false);
        valor = formatter.stringToValue(valor).toString();
      }
    } catch (ParseException e) {
      log.info(e.getMessage());
    }
    return valor;
View Full Code Here

Examples of javax.swing.text.MaskFormatter.stringToValue()

   */
  public static Calendar convertStringHHMM2TimeCalendarTolerant(String toConvert) throws ParseException {
    if (toConvert != null) {
      // check if the string matches the mask
      MaskFormatter mf = new MaskFormatter(Converter.TIME_MASK);
      mf.stringToValue(toConvert);
      int pos = toConvert.indexOf(Converter.TIME_SEPARATOR);
      String h_str = toConvert.substring(0, pos);
      Integer h = new Integer(h_str);
      String min_str = toConvert.substring(pos + 1);
      Integer min = new Integer(min_str);
View Full Code Here

Examples of javax.swing.text.MaskFormatter.stringToValue()

   */
  public static BigDecimal convertStringHHMM2BigDecimalTolerant(String toConvert) throws ParseException {
    if (toConvert != null) {
      // check if the string matches the mask
      MaskFormatter mf = new MaskFormatter(Converter.TIME_MASK);
      mf.stringToValue(toConvert);
      int pos = toConvert.indexOf(Converter.TIME_SEPARATOR);
      String h = toConvert.substring(0, pos);
      String m = toConvert.substring(pos + 1);
      BigDecimal t = new BigDecimal(m + ".00");
      t = t.divide(new BigDecimal("60.00"), BigDecimal.ROUND_HALF_UP);
View Full Code Here

Examples of javax.swing.text.MaskFormatter.stringToValue()

     */
    public static Calendar convertStringHHMM2TimeCalendarTolerant(String toConvert) throws ParseException {
        if (toConvert != null) {
            // check if the string matches the mask
            MaskFormatter mf = new MaskFormatter(Converter.TIME_MASK);
            mf.stringToValue(toConvert);
            int pos = toConvert.indexOf(Converter.TIME_SEPARATOR);
            String h_str = toConvert.substring(0, pos);
            Integer h = new Integer(h_str);
            String min_str = toConvert.substring(pos + 1);
            Integer min = new Integer(min_str);
View Full Code Here

Examples of javax.swing.text.MaskFormatter.stringToValue()

     */
    public static BigDecimal convertStringHHMM2BigDecimalTolerant(String toConvert) throws ParseException {
        if (toConvert != null) {
            // check if the string matches the mask
            MaskFormatter mf = new MaskFormatter(Converter.TIME_MASK);
            mf.stringToValue(toConvert);
            int pos = toConvert.indexOf(Converter.TIME_SEPARATOR);
            String h = toConvert.substring(0, pos);
            String m = toConvert.substring(pos + 1);
            BigDecimal t = new BigDecimal(m + ".00");
            t = t.divide(new BigDecimal("60.00"), BigDecimal.ROUND_HALF_UP);
View Full Code Here

Examples of javax.swing.text.NumberFormatter.stringToValue()

        removeAttribute(MediaMargins.class);
        return true;
    }

    try {
        x1 = ((Float) format.stringToValue(leftTxt.getText())).floatValue();
        x2 = ((Float) format.stringToValue(rightTxt.getText())).floatValue();
        y1 = ((Float) format.stringToValue(topTxt.getText())).floatValue();
        y2 = ((Float) format.stringToValue(bottomTxt.getText())).floatValue();
    } catch(ParseException e) {
        return false;
View Full Code Here

Examples of javax.swing.text.NumberFormatter.stringToValue()

        return true;
    }

    try {
        x1 = ((Float) format.stringToValue(leftTxt.getText())).floatValue();
        x2 = ((Float) format.stringToValue(rightTxt.getText())).floatValue();
        y1 = ((Float) format.stringToValue(topTxt.getText())).floatValue();
        y2 = ((Float) format.stringToValue(bottomTxt.getText())).floatValue();
    } catch(ParseException e) {
        return false;
    }
View Full Code Here

Examples of javax.swing.text.NumberFormatter.stringToValue()

    }

    try {
        x1 = ((Float) format.stringToValue(leftTxt.getText())).floatValue();
        x2 = ((Float) format.stringToValue(rightTxt.getText())).floatValue();
        y1 = ((Float) format.stringToValue(topTxt.getText())).floatValue();
        y2 = ((Float) format.stringToValue(bottomTxt.getText())).floatValue();
    } catch(ParseException e) {
        return false;
    }
View Full Code Here

Examples of javax.swing.text.NumberFormatter.stringToValue()

    try {
        x1 = ((Float) format.stringToValue(leftTxt.getText())).floatValue();
        x2 = ((Float) format.stringToValue(rightTxt.getText())).floatValue();
        y1 = ((Float) format.stringToValue(topTxt.getText())).floatValue();
        y2 = ((Float) format.stringToValue(bottomTxt.getText())).floatValue();
    } catch(ParseException e) {
        return false;
    }

    if (sizeBox.isEnabled()
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.