Class JNumberField

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

public class JNumberField extends JTextField
Like JTextField, but only allows numbers (or empty)
Since:
13.7
See Also:
  • Constructor Details

    • JNumberField

      public JNumberField()
    • JNumberField

      public JNumberField(String text)
    • JNumberField

      public JNumberField(int columns)
    • JNumberField

      public JNumberField(String text, int columns)
    • JNumberField

      public JNumberField(Document doc, String text, int columns)
  • Method Details

    • isAllowNegative

      public boolean isAllowNegative()
    • setAllowNegative

      public JNumberField setAllowNegative(boolean allowNegative)
      Whether to allow negative numbers as well Defaults to positive numbers
      Parameters:
      allowNegative -
      Returns:
    • isAllowDecimals

      public boolean isAllowDecimals()
      Whether to allow decimal numbers or not Defaults to integers
      Returns:
    • setAllowDecimals

      public JNumberField setAllowDecimals(boolean allowDecimals)