Class JNumberField

All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable, Accessible, Scrollable, SwingConstants

public class JNumberField extends JTextField
数値入力専用テキストフィールド
See Also:
  • Constructor Details

    • JNumberField

      public JNumberField()
    • JNumberField

      public JNumberField(long defaultValue)
    • JNumberField

      public JNumberField(double defaultValue)
    • JNumberField

      public JNumberField(Number defaultValue)
    • JNumberField

      public JNumberField(Number defaultValue, int columns)
    • JNumberField

      protected JNumberField(String text, int columns)
  • Method Details

    • isNull

      public boolean isNull()
    • isAllowDouble

      public boolean isAllowDouble()
      小数を許すか否か
    • setAllowDouble

      public void setAllowDouble(boolean b)
      小数を許すか否か
    • isAllowNegative

      public boolean isAllowNegative()
      負の数を許すか否か
    • setAllowNegative

      public void setAllowNegative(boolean b)
      負の数を許すか否か
    • getMaxLength

      public int getMaxLength()
      桁数の制限。 n > 0の場合その桁数以上は入力不可
    • setMaxLength

      public void setMaxLength(int len)
      桁数の制限。 n > 0の場合その桁数以上は入力不可
    • longValue

      public long longValue() throws NumberFormatException
      Textのlong値を返す
      Throws:
      NumberFormatException
    • doubleValue

      public double doubleValue() throws NumberFormatException
      Textのdouble値を返す
      Throws:
      NumberFormatException
    • decimalValue

      public BigDecimal decimalValue() throws NumberFormatException
      Textのdouble値を返す
      Throws:
      NumberFormatException