Java JTextField Value Get getInt(javax.swing.JTextField input)

Here you can find the source of getInt(javax.swing.JTextField input)

Description

Get int from the JTextField input

License

Open Source License

Parameter

Parameter Description
input the JTextField object

Return

the int number

Declaration

public static int getInt(javax.swing.JTextField input) throws Exception 

Method Source Code

//package com.java2s;
/*//from  w w  w  . j  a v  a 2s  .co  m
 * @(#)VerifyUtil.java   
 *
 * Copyright (C) 2006 www.interpss.com
 *
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU LESSER GENERAL PUBLIC LICENSE
 * as published by the Free Software Foundation; either version 2.1
 * of the License, or (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * @Author Mike Zhou
 * @Version 1.0
 * @Date 09/15/2006
 * 
 *   Revision History
 *   ================
 *
 */

public class Main {
    /**
     * Get int from the JTextField input
     * 
     * @param input the JTextField object
     * @return the int number
     */
    public static int getInt(javax.swing.JTextField input) throws Exception {
        return new Integer(input.getText()).intValue();
    }
}

Related

  1. getDouble(javax.swing.JTextField input)
  2. getDoubleFromTextField(JTextField textField, double defaultValue)
  3. getDoubleTextField(javax.swing.JTextField textField)
  4. getFieldValue(JTextField tf)
  5. getInt(JTextField tf)
  6. getInteger(JTextField txt, Integer defaultVal)
  7. getIntegerFromTextField(JTextField tf, int previousValue)
  8. getIntValue(JTextField component)