public class FilteredJTextField
extends javax.swing.JTextField
javax.swing.JTextField.AccessibleJTextFieldjavax.swing.text.JTextComponent.AccessibleJTextComponent, javax.swing.text.JTextComponent.DropLocation, javax.swing.text.JTextComponent.KeyBindingjavax.swing.JComponent.AccessibleJComponent| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
ALPHA_CAP_CHARS
Static string containing the upper-case characters 'A' through 'Z'.
|
static java.lang.String |
ALPHA_CHARS
Static string containing the characters 'A' through 'Z' and 'a'
through 'z'.
|
static java.lang.String |
ALPHA_LOW_CHARS
Static string containing the lower-case characters 'a' through 'z'.
|
static java.lang.String |
ALPHANUMERIC_CHARS
Static string containing the characters 'A' through 'Z', 'a'
through 'z' and '0' though '9'.
|
static java.lang.String |
EFLOAT_CHARS
Static string containing the numeric characters '0' through '9',
the decimal point character '.' and the exponent characters 'e'
and 'E'.
|
static java.lang.String |
FLOAT_CHARS
Static string containing the numeric characters '0' through '9'
and the decimal point character '.'.
|
static java.lang.String |
HEX_ALPHA_CAP_CHARS
Static string containing the upper-case HEX characters 'A' through 'F'.
|
static java.lang.String |
HEX_ALPHA_LOW_CHARS
Static string containing the lower-case HEX characters 'a' through 'f'.
|
static java.lang.String |
HEX_CHARS
Static string containing the HEX characters.
|
static java.lang.String |
INTEGER_CHARS
Static string containing the numeric characters '0' through '9'.
|
static java.lang.String |
SIGNED_EFLOAT_CHARS
Static string containing the numeric characters '0' through '9',
the decimal point character '.', the exponent characters 'e'
and 'E', and the sign characters '-' and '+'.
|
static java.lang.String |
SIGNED_FLOAT_CHARS
Static string containing the numeric characters '0' through '9',
the decimal point character '.' and the sign characters '-' and '+'.
|
static java.lang.String |
SIGNED_INT_CHARS
Static string containing the numeric characters '0' through '9'
and the sign characters '-' and '+'.
|
static java.lang.String |
TOD_CHARS
Static string containing the characters needed to specify a time
of day ('0' through '9', ':' and '.').
|
static java.lang.String |
WILDCARD_ALL_CHAR
Static string containing the asterisk wildcard character.
|
static java.lang.String |
WILDCARD_CHARS
Static string containing asterisk and question-mark wildcard
characters.
|
static java.lang.String |
WILDCARD_SINGLE_CHAR
Static string containing the question-mark wildcard character.
|
listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOWaccessibleContext, BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT| Constructor and Description |
|---|
FilteredJTextField()
Creates a new 'FilteredJTextField' object.
|
FilteredJTextField(int maxNumChars)
Creates a new 'FilteredJTextField' object.
|
FilteredJTextField(int columns,
java.lang.String allowedChars)
Creates a new 'FilteredJTextField' object.
|
FilteredJTextField(java.lang.String text)
Creates a new 'FilteredJTextField' object initialized with the
given text.
|
FilteredJTextField(java.lang.String text,
int maxNumChars)
Creates a new 'FilteredJTextField' object initialized with the
given text.
|
FilteredJTextField(java.lang.String text,
int columns,
boolean isFloatFlag,
boolean isUnsignedFlag)
Creates a new 'FilteredJTextField' object initialized with the
given text for numeric values.
|
FilteredJTextField(java.lang.String text,
int columns,
java.lang.String allowedChars)
Creates a new 'FilteredJTextField' object initialized with the
given text.
|
FilteredJTextField(java.lang.String text,
int columns,
java.lang.String allowedChars,
boolean numericFlag)
Creates a new 'FilteredJTextField' object initialized with the
given text.
|
FilteredJTextField(java.lang.String text,
int columns,
java.lang.String allowedChars,
boolean numericFlag,
int maxNumChars)
Creates a new 'FilteredJTextField' object initialized with the
given text.
|
FilteredJTextField(java.lang.String text,
int columns,
java.lang.String specialChars,
boolean numericFlag,
int maxNumChars,
boolean allowFlag)
Creates a new 'FilteredJTextField' object initialized with the
given text.
|
FilteredJTextField(java.lang.String text,
int columns,
java.lang.String allowedChars,
int maxNumChars)
Creates a new 'FilteredJTextField' object initialized with the
given text.
|
FilteredJTextField(java.lang.String text,
java.lang.String allowedChars)
Creates a new 'FilteredJTextField' object initialized with the
given text.
|
FilteredJTextField(java.lang.String text,
java.lang.String allowedChars,
boolean numericFlag)
Creates a new 'FilteredJTextField' object initialized with the
given text.
|
FilteredJTextField(java.lang.String text,
java.lang.String allowedChars,
boolean numericFlag,
int maxNumChars)
Creates a new 'FilteredJTextField' object initialized with the
given text.
|
FilteredJTextField(java.lang.String text,
java.lang.String allowedChars,
int maxNumChars)
Creates a new 'FilteredJTextField' object initialized with the
given text.
|
| Modifier and Type | Method and Description |
|---|---|
static java.lang.String |
getAllowedNumberChars(boolean isFloatFlag,
boolean isUnsignedFlag)
Gets the allowed number characters.
|
int |
getIntegerValue()
Gets the integer value represented by this text field.
|
java.lang.Comparable |
getMaxValueObj()
Returns the maximum value to be allowed for numeric entries, or
null if no value has been entered.
|
FilteredJTextField |
setMaxValue(byte val)
Sets a maximum value to be allowed for numeric entries (only
used if the 'numericFlag' is true).
|
FilteredJTextField |
setMaxValue(java.lang.Comparable compObj)
Sets a maximum value to be allowed for numeric entries (only
used if the 'numericFlag' is true).
|
FilteredJTextField |
setMaxValue(double val)
Sets a maximum value to be allowed for numeric entries (only
used if the 'numericFlag' is true).
|
FilteredJTextField |
setMaxValue(float val)
Sets a maximum value to be allowed for numeric entries (only
used if the 'numericFlag' is true).
|
FilteredJTextField |
setMaxValue(int val)
Sets a maximum value to be allowed for numeric entries (only
used if the 'numericFlag' is true).
|
FilteredJTextField |
setMaxValue(long val)
Sets a maximum value to be allowed for numeric entries (only
used if the 'numericFlag' is true).
|
FilteredJTextField |
setMaxValue(short val)
Sets a maximum value to be allowed for numeric entries (only
used if the 'numericFlag' is true).
|
actionPropertyChanged, addActionListener, configurePropertiesFromAction, createActionPropertyChangeListener, createDefaultModel, fireActionPerformed, getAccessibleContext, getAction, getActionListeners, getActions, getColumns, getColumnWidth, getHorizontalAlignment, getHorizontalVisibility, getPreferredSize, getScrollOffset, getUIClassID, isValidateRoot, paramString, postActionEvent, removeActionListener, scrollRectToVisible, setAction, setActionCommand, setColumns, setDocument, setFont, setHorizontalAlignment, setScrollOffsetaddCaretListener, addInputMethodListener, addKeymap, copy, cut, fireCaretUpdate, getCaret, getCaretColor, getCaretListeners, getCaretPosition, getDisabledTextColor, getDocument, getDragEnabled, getDropLocation, getDropMode, getFocusAccelerator, getHighlighter, getInputMethodRequests, getKeymap, getKeymap, getMargin, getNavigationFilter, getPreferredScrollableViewportSize, getPrintable, getScrollableBlockIncrement, getScrollableTracksViewportHeight, getScrollableTracksViewportWidth, getScrollableUnitIncrement, getSelectedText, getSelectedTextColor, getSelectionColor, getSelectionEnd, getSelectionStart, getText, getText, getToolTipText, getUI, isEditable, loadKeymap, modelToView, moveCaretPosition, paste, print, print, print, processInputMethodEvent, read, removeCaretListener, removeKeymap, removeNotify, replaceSelection, restoreComposedText, saveComposedText, select, selectAll, setCaret, setCaretColor, setCaretPosition, setComponentOrientation, setDisabledTextColor, setDragEnabled, setDropMode, setEditable, setFocusAccelerator, setHighlighter, setKeymap, setMargin, setNavigationFilter, setSelectedTextColor, setSelectionColor, setSelectionEnd, setSelectionStart, setText, setUI, updateUI, viewToModel, writeaddAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBaseline, getBaselineResizeBehavior, getBorder, getBounds, getClientProperty, getComponentGraphics, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPopupLocation, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, hide, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingOrigin, isPaintingTile, isRequestFocusEnabled, paint, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFocusTraversalKeys, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, updateadd, add, add, add, add, addContainerListener, addImpl, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, getMousePosition, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, transferFocusDownCycle, validate, validateTreeaction, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCyclepublic static final java.lang.String INTEGER_CHARS
public static final java.lang.String HEX_ALPHA_CAP_CHARS
public static final java.lang.String HEX_ALPHA_LOW_CHARS
public static final java.lang.String HEX_CHARS
public static final java.lang.String SIGNED_INT_CHARS
public static final java.lang.String FLOAT_CHARS
public static final java.lang.String SIGNED_FLOAT_CHARS
public static final java.lang.String EFLOAT_CHARS
public static final java.lang.String SIGNED_EFLOAT_CHARS
public static final java.lang.String ALPHA_CAP_CHARS
public static final java.lang.String ALPHA_LOW_CHARS
public static final java.lang.String ALPHA_CHARS
public static final java.lang.String ALPHANUMERIC_CHARS
public static final java.lang.String TOD_CHARS
public static final java.lang.String WILDCARD_ALL_CHAR
public static final java.lang.String WILDCARD_SINGLE_CHAR
public static final java.lang.String WILDCARD_CHARS
public FilteredJTextField()
public FilteredJTextField(java.lang.String text)
text - text stringpublic FilteredJTextField(java.lang.String text,
java.lang.String allowedChars,
boolean numericFlag)
text - the initial text for the field.allowedChars - a String of characters allowed to be entered
into the field.numericFlag - true if only valid numeric data is to be allowed.public FilteredJTextField(java.lang.String text,
java.lang.String allowedChars)
text - the initial text for the field.allowedChars - a String of characters allowed to be entered
into the field.public FilteredJTextField(java.lang.String text,
int columns,
boolean isFloatFlag,
boolean isUnsignedFlag)
text - the initial text for the field.columns - the number of the columns for the field.isFloatFlag - true if floating point number.isUnsignedFlag - true if unsigned number.public FilteredJTextField(java.lang.String text,
int columns,
java.lang.String allowedChars,
boolean numericFlag)
text - the initial text for the field.allowedChars - a String of characters allowed to be entered
into the field.columns - the number of the columns for the field.numericFlag - true if only valid numeric data is to be allowed.public FilteredJTextField(java.lang.String text,
int columns,
java.lang.String allowedChars)
text - the initial text for the field.allowedChars - a String of characters allowed to be entered
into the field.columns - the number of the columns for the field.public FilteredJTextField(int columns,
java.lang.String allowedChars)
allowedChars - a String of characters allowed to be entered
into the field.columns - the number of the columns for the field.public FilteredJTextField(int maxNumChars)
maxNumChars - maximum number of characters allowed (or 0
for no limit).public FilteredJTextField(java.lang.String text,
int maxNumChars)
text - text stringmaxNumChars - maximum number of characters allowed (or 0
for no limit).public FilteredJTextField(java.lang.String text,
java.lang.String allowedChars,
boolean numericFlag,
int maxNumChars)
text - the initial text for the field.allowedChars - a String of characters allowed to be entered
into the field.numericFlag - true if only valid numeric data is to be allowed.maxNumChars - maximum number of characters allowed (or 0
for no limit).public FilteredJTextField(java.lang.String text,
java.lang.String allowedChars,
int maxNumChars)
text - the initial text for the field.allowedChars - a String of characters allowed to be entered
into the field.maxNumChars - maximum number of characters allowed (or 0
for no limit).public FilteredJTextField(java.lang.String text,
int columns,
java.lang.String allowedChars,
boolean numericFlag,
int maxNumChars)
text - the initial text for the field.allowedChars - a String of characters allowed to be entered
into the field.columns - the number of the columns for the field.numericFlag - true if only valid numeric data is to be allowed.maxNumChars - maximum number of characters allowed (or 0
for no limit).public FilteredJTextField(java.lang.String text,
int columns,
java.lang.String specialChars,
boolean numericFlag,
int maxNumChars,
boolean allowFlag)
text - the initial text for the field.specialChars - a String of characters allowed (or not) to be entered
into the field.columns - the number of the columns for the field.numericFlag - true if only valid numeric data is to be allowed.maxNumChars - maximum number of characters allowed (or 0
for no limit).allowFlag - true to allow only the special characters, false to not
allow the special characters.public FilteredJTextField(java.lang.String text,
int columns,
java.lang.String allowedChars,
int maxNumChars)
text - the initial text for the field.allowedChars - a String of characters allowed to be entered
into the field.columns - the number of the columns for the field.maxNumChars - maximum number of characters allowed (or 0
for no limit).public static final java.lang.String getAllowedNumberChars(boolean isFloatFlag,
boolean isUnsignedFlag)
isFloatFlag - true if floating point number.isUnsignedFlag - true if unsigned number.public FilteredJTextField setMaxValue(java.lang.Comparable compObj)
compObj - a "maximum" value object that implements the
'Comparable' interface (or null for no maximum).public int getIntegerValue()
public java.lang.Comparable getMaxValueObj()
public FilteredJTextField setMaxValue(int val)
val - maximum value to be allowed.public FilteredJTextField setMaxValue(long val)
val - maximum value to be allowed.public FilteredJTextField setMaxValue(short val)
val - maximum value to be allowed.public FilteredJTextField setMaxValue(byte val)
val - maximum value to be allowed.public FilteredJTextField setMaxValue(double val)
val - maximum value to be allowed.public FilteredJTextField setMaxValue(float val)
val - maximum value to be allowed.