Package javax.swing.text

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


    {
        String timestamp;
        NumberFormatter formatter = new NumberFormatter();
        formatter.setFormat(new DecimalFormat("00"));
        timestamp = Integer.toString(cal.get(GregorianCalendar.YEAR));
        timestamp += "-" + formatter.valueToString(cal.get(GregorianCalendar.MONTH)+1);
        timestamp += "-" + formatter.valueToString(cal.get(GregorianCalendar.DAY_OF_MONTH));
        timestamp += "T" + formatter.valueToString(cal.get(GregorianCalendar.HOUR_OF_DAY));
        timestamp += "-" + formatter.valueToString(cal.get(GregorianCalendar.MINUTE));
        return timestamp;
    }
View Full Code Here


        String timestamp;
        NumberFormatter formatter = new NumberFormatter();
        formatter.setFormat(new DecimalFormat("00"));
        timestamp = Integer.toString(cal.get(GregorianCalendar.YEAR));
        timestamp += "-" + formatter.valueToString(cal.get(GregorianCalendar.MONTH)+1);
        timestamp += "-" + formatter.valueToString(cal.get(GregorianCalendar.DAY_OF_MONTH));
        timestamp += "T" + formatter.valueToString(cal.get(GregorianCalendar.HOUR_OF_DAY));
        timestamp += "-" + formatter.valueToString(cal.get(GregorianCalendar.MINUTE));
        return timestamp;
    }
   
View Full Code Here

        NumberFormatter formatter = new NumberFormatter();
        formatter.setFormat(new DecimalFormat("00"));
        timestamp = Integer.toString(cal.get(GregorianCalendar.YEAR));
        timestamp += "-" + formatter.valueToString(cal.get(GregorianCalendar.MONTH)+1);
        timestamp += "-" + formatter.valueToString(cal.get(GregorianCalendar.DAY_OF_MONTH));
        timestamp += "T" + formatter.valueToString(cal.get(GregorianCalendar.HOUR_OF_DAY));
        timestamp += "-" + formatter.valueToString(cal.get(GregorianCalendar.MINUTE));
        return timestamp;
    }
   
   
View Full Code Here

        formatter.setFormat(new DecimalFormat("00"));
        timestamp = Integer.toString(cal.get(GregorianCalendar.YEAR));
        timestamp += "-" + formatter.valueToString(cal.get(GregorianCalendar.MONTH)+1);
        timestamp += "-" + formatter.valueToString(cal.get(GregorianCalendar.DAY_OF_MONTH));
        timestamp += "T" + formatter.valueToString(cal.get(GregorianCalendar.HOUR_OF_DAY));
        timestamp += "-" + formatter.valueToString(cal.get(GregorianCalendar.MINUTE));
        return timestamp;
    }
   
   
   
View Full Code Here

* Set Margins dialog fields in accordance with the given MediaMargins object
*/
private void setMargins(MediaMargins margins) {
    NumberFormatter fmt = getFloatFormatter();
    try {
        leftTxt.setText(fmt.valueToString(
                new Float(margins.getX1(MediaMargins.MM))));
        rightTxt.setText(fmt.valueToString(
                new Float(margins.getX2(MediaMargins.MM))));
        topTxt.setText(fmt.valueToString(
                new Float(margins.getY1(MediaMargins.MM))));
View Full Code Here

private void setMargins(MediaMargins margins) {
    NumberFormatter fmt = getFloatFormatter();
    try {
        leftTxt.setText(fmt.valueToString(
                new Float(margins.getX1(MediaMargins.MM))));
        rightTxt.setText(fmt.valueToString(
                new Float(margins.getX2(MediaMargins.MM))));
        topTxt.setText(fmt.valueToString(
                new Float(margins.getY1(MediaMargins.MM))));
        bottomTxt.setText(fmt.valueToString(
                new Float(margins.getY2(MediaMargins.MM))));
View Full Code Here

    try {
        leftTxt.setText(fmt.valueToString(
                new Float(margins.getX1(MediaMargins.MM))));
        rightTxt.setText(fmt.valueToString(
                new Float(margins.getX2(MediaMargins.MM))));
        topTxt.setText(fmt.valueToString(
                new Float(margins.getY1(MediaMargins.MM))));
        bottomTxt.setText(fmt.valueToString(
                new Float(margins.getY2(MediaMargins.MM))));
    } catch (ParseException e) {
        /* Ignore incorrect float format */
 
View Full Code Here

                new Float(margins.getX1(MediaMargins.MM))));
        rightTxt.setText(fmt.valueToString(
                new Float(margins.getX2(MediaMargins.MM))));
        topTxt.setText(fmt.valueToString(
                new Float(margins.getY1(MediaMargins.MM))));
        bottomTxt.setText(fmt.valueToString(
                new Float(margins.getY2(MediaMargins.MM))));
    } catch (ParseException e) {
        /* Ignore incorrect float format */
    }
}
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

        this.writer.write(122, LINHA8, boleto.getEmissor().getCarteira());

        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

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.