public class IntField extends TextField implements FocusListener
TextField.AccessibleAWTTextField
TextComponent.AccessibleAWTTextComponent
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy
textListener
accessibleContext, BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
Constructor and Description |
---|
IntField()
Constructs an IntField with value 0 and maximal bounds.
|
IntField(int value)
Constructs an IntField with the specified value and maximal bounds.
|
IntField(int value,
int minValue,
int maxValue)
Constructs an IntField with specified value and bounds.
|
IntField(int value,
int minValue,
int maxValue,
int columns)
Constructs an IntField with specified value, bounds and number of columns.
|
IntField(int value,
int minValue,
int maxValue,
int columns,
String actionCommand)
Constructs an IntField with specified value, bounds, number of columns, and command string of the ActionEvent.
|
Modifier and Type | Method and Description |
---|---|
void |
focusGained(FocusEvent e) |
void |
focusLost(FocusEvent e) |
String |
getActionCommand()
Returns the action command string.
|
int |
getValue() |
protected void |
processActionEvent(ActionEvent e)
Hand on an ActionEvent to listeners only if a new and valid
integer has been entered.
|
void |
setActionCommand(String newCommand)
Sets the command string returned by an ActionEvent.
|
void |
setValue(int newValue)
Sets the value of the field to newValue without sending an ActionEvent.
|
void |
setValue(int newValue,
boolean sendEvent)
Sets the value of the field to newValue.
|
addActionListener, addNotify, echoCharIsSet, getAccessibleContext, getActionListeners, getColumns, getEchoChar, getListeners, getMinimumSize, getMinimumSize, getPreferredSize, getPreferredSize, minimumSize, minimumSize, paramString, preferredSize, preferredSize, processEvent, removeActionListener, setColumns, setEchoChar, setEchoCharacter, setText
addTextListener, enableInputMethods, getBackground, getCaretPosition, getInputMethodRequests, getSelectedText, getSelectionEnd, getSelectionStart, getText, getTextListeners, isEditable, processTextEvent, removeNotify, removeTextListener, select, selectAll, setBackground, setCaretPosition, setEditable, setSelectionEnd, setSelectionStart
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, bounds, checkImage, checkImage, coalesceEvents, contains, contains, createImage, createImage, createVolatileImage, createVolatileImage, deliverEvent, disable, disableEvents, dispatchEvent, doLayout, enable, enable, enableEvents, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getAlignmentX, getAlignmentY, getBaseline, getBaselineResizeBehavior, getBounds, getBounds, getColorModel, getComponentAt, getComponentAt, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeys, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphics, getGraphicsConfiguration, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getKeyListeners, getLocale, getLocation, getLocation, getLocationOnScreen, getMaximumSize, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getSize, getToolkit, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, invalidate, isBackgroundSet, isCursorSet, isDisplayable, isDoubleBuffered, isEnabled, isFocusable, isFocusCycleRoot, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, layout, list, list, list, list, list, locate, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paint, paintAll, postEvent, prepareImage, prepareImage, print, printAll, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, reshape, resize, resize, revalidate, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeys, setFocusTraversalKeysEnabled, setFont, setForeground, setIgnoreRepaint, setLocale, setLocation, setLocation, setMaximumSize, setMinimumSize, setName, setPreferredSize, setSize, setSize, setVisible, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle, update, validate
public IntField()
public IntField(int value)
public IntField(int value, int minValue, int maxValue)
public IntField(int value, int minValue, int maxValue, int columns)
public IntField(int value, int minValue, int maxValue, int columns, String actionCommand)
public int getValue()
public void setValue(int newValue)
public void setValue(int newValue, boolean sendEvent)
public void setActionCommand(String newCommand)
public String getActionCommand()
protected void processActionEvent(ActionEvent e)
processActionEvent
in class TextField
public void focusLost(FocusEvent e)
focusLost
in interface FocusListener
public void focusGained(FocusEvent e)
focusGained
in interface FocusListener
Copyright © 2015–2021 Fiji. All rights reserved.