Package javax.swing.text

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


        try {
            formatter.setFormat(yformat);
            String year = formatter.valueToString(new Integer(cal.get(Calendar.YEAR)));
            formatter.setFormat(format);
            String month = formatter.valueToString(new Integer(cal.get(Calendar.MONTH) + 1));
            String day = formatter.valueToString(new Integer(cal.get(Calendar.DAY_OF_MONTH)));

            return year + month + day;
        } catch (ParseException e) {
            logger.error("Error during parsing.", e);
            throw new ICalendarServiceException(
View Full Code Here


            this.writer.write(230, LINHA2, formatDate(boleto.getDatas()
                    .getVencimento()));

            try {
                this.writer.write(400, LINHA2, formatter.valueToString(boleto
                        .getValorBoleto().doubleValue()));
            } catch (NumberFormatException e) {
                throw new CriacaoBoletoException(
                        "Erro na formatação do valor do boleto", e);
            } catch (ParseException e) {
View Full Code Here

                    .getCarteiraDoEmissorFormatado(boleto.getEmissor()));

            this.writer.write(190, LINHA8, boleto.getEspecieMoeda());

            try {
                this.writer.write(430, LINHA8, formatter.valueToString(boleto
                        .getValorBoleto().doubleValue()));
            } catch (NumberFormatException e) {
                throw new CriacaoBoletoException(
                        "Erro na formatação do valor do boleto", e);
            } catch (ParseException e) {
View Full Code Here

        /* TBD - initializing the column width of the text field
         * is imprecise and doing it here is tricky because
         * the developer may configure the formatter later.
         */
        try {
            String maxString = formatter.valueToString(model.getMinimum());
            String minString = formatter.valueToString(model.getMaximum());
            ftf.setColumns(Math.max(maxString.length(), minString.length()));
        }
        catch (ParseException e) {
            // TBD should throw a chained error here
View Full Code Here

         * is imprecise and doing it here is tricky because
         * the developer may configure the formatter later.
         */
        try {
            String maxString = formatter.valueToString(model.getMinimum());
            String minString = formatter.valueToString(model.getMaximum());
            ftf.setColumns(Math.max(maxString.length(), minString.length()));
        }
        catch (ParseException e) {
            // TBD should throw a chained error here
        }
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.