Package javax.swing.text

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


     * 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

     * 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

        DecimalFormat format = new DecimalFormat("00");
        NumberFormatter formatter = new NumberFormatter();

        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;
View Full Code Here

        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);
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.