Class JTextField
java.lang.Object
vaadinx.awt.Component
vaadinx.awt.Container
vaadinx.swing.JComponent
vaadinx.swing.text.JTextComponent
vaadinx.swing.JTextField
- All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable, Accessible, Scrollable, SwingConstants
- Direct Known Subclasses:
JFormattedTextField, JPasswordField
Emulator for
JTextField.- See Also:
-
Field Summary
FieldsFields inherited from class JTextComponent
DEFAULT_KEYMAP, FOCUS_ACCELERATOR_KEY, preventPeerEventsFields inherited from class JComponent
TOOL_TIP_TEXT_KEY, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOWFields inherited from class Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, FILL_CHROME, FILL_DEFAULT, LEFT_ALIGNMENT, listenerList, RIGHT_ALIGNMENT, TOP_ALIGNMENTFields inherited from interface ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTHFields inherited from interface SwingConstants
BOTTOM, CENTER, EAST, HORIZONTAL, LEADING, LEFT, NEXT, NORTH, NORTH_EAST, NORTH_WEST, PREVIOUS, RIGHT, SOUTH, SOUTH_EAST, SOUTH_WEST, TOP, TRAILING, VERTICAL, WEST -
Constructor Summary
ConstructorsModifierConstructorDescriptionJTextField(int columns) protectedJTextField(com.vaadin.flow.component.Component peer) protected <P extends com.vaadin.flow.component.Component>JTextField(Class<P> peerType, Supplier<? extends P> peerFactory) The lazy form: seeComponent(Class, java.util.function.Supplier).JTextField(String text) JTextField(String text, int columns) JTextField(Document doc, String text, int columns) -
Method Summary
Modifier and TypeMethodDescriptionprotected voidactionPropertyChanged(Action a, String propertyName) voidprotected voidprotected PropertyChangeListenerprotected DocumentRoutes the base class's construction-time document factory to this class's JDK-shaped one, so that a subclass overridingcreateDefaultModel()— the only hook Swing offers here — is actually reached (R_no_vaadin_in_api second limb, D_r12_provenance).protected DocumentThe JDK's document factory for this class, and the documented seam for installing a customDocument(a filteringPlainDocumentsubclass, typically) on a JTextField subclass.protected voidAction[]intprotected intintintbooleanprotected StringvoidvoidvoidvoidvoidsetActionCommand(String command) voidsetColumns(int columns) voidvoidsetHorizontalAlignment(int alignment) voidsetScrollOffset(int scrollOffset) Stores the offset without scrolling anything — the browser owns the input's horizontal scroll position, and R_decline_effect_only permits dropping the effect but not the state.Methods inherited from class JTextComponent
addCaretListener, addKeymap, copy, cut, fireCaretUpdate, getCaret, getCaretColor, getCaretListeners, getCaretPosition, getDisabledTextColor, getDocument, getDragEnabled, getDropMode, getFocusAccelerator, getHighlighter, getInputMethodRequests, getKeymap, getKeymap, getMargin, getNavigationFilter, getPreferredScrollableViewportSize, getPrintable, getScrollableBlockIncrement, getScrollableTracksViewportHeight, getScrollableTracksViewportWidth, getScrollableUnitIncrement, getSelectedText, getSelectedTextColor, getSelectionColor, getSelectionEnd, getSelectionStart, getText, getText, getToolTipText, getUI, isEditable, modelToView, modelToView2D, moveCaretPosition, paste, print, print, print, read, removeCaretListener, removeKeymap, removeNotify, replaceSelection, restoreComposedText, saveComposedText, select, selectAll, setCaret, setCaretColor, setCaretPosition, setComponentOrientation, setDisabledTextColor, setDocument, setDragEnabled, setDropMode, setEditable, setFocusAccelerator, setHighlighter, setKeymap, setMargin, setNavigationFilter, setSelectedTextColor, setSelectionColor, setSelectionEnd, setSelectionStart, setText, setUI, updateUI, viewToModel, viewToModel2D, writeMethods inherited from class JComponent
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBaseline, 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, 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, updateMethods inherited from class Container
add, add, add, add, add, addContainerListener, addImpl, addPropertyChangeListener, addPropertyChangeListener, addSlotChild, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, fireHierarchyEvent, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, getMousePosition, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, peerContentElement, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, removeSlotChild, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, transferFocusDownCycle, validate, validateTreeMethods inherited from class Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, applyBackgroundToPeer, applyVisibleToPeer, awtListeners, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, createVolatileImage, createVolatileImage, defaultFillCssClass, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, fireComponentEvent, 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, isThemeDefault, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, peerIs, postEvent, prepareImage, prepareImage, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, 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, setMixingCutoutShape, setName, setSize, setSize, show, show, size, suppressMouseBridge, toString, transferFocus, transferFocusBackward, transferFocusUpCycle, withPeer, withPeerOnLiveUI
-
Field Details
-
notifyAction
- See Also:
-
-
Constructor Details
-
JTextField
public JTextField() -
JTextField
-
JTextField
public JTextField(int columns) -
JTextField
-
JTextField
-
JTextField
protected JTextField(com.vaadin.flow.component.Component peer) -
JTextField
protected <P extends com.vaadin.flow.component.Component> JTextField(Class<P> peerType, Supplier<? extends P> peerFactory) The lazy form: seeComponent(Class, java.util.function.Supplier).
-
-
Method Details
-
getColumns
public int getColumns() -
setColumns
public void setColumns(int columns) -
getHorizontalAlignment
public int getHorizontalAlignment() -
setHorizontalAlignment
public void setHorizontalAlignment(int alignment) -
addActionListener
-
removeActionListener
-
getActionListeners
-
fireActionPerformed
protected void fireActionPerformed() -
setActionCommand
-
postActionEvent
public void postActionEvent() -
createDefaultModel
-
createDefaultDocument
Routes the base class's construction-time document factory to this class's JDK-shaped one, so that a subclass overridingcreateDefaultModel()— the only hook Swing offers here — is actually reached (R_no_vaadin_in_api second limb, D_r12_provenance).Inherits the JDK's own footgun along with its shape: the call happens during
JTextComponent's constructor, so an override reading the subclass's own fields sees them uninitialized. Swing behaves identically, for the same reason.- Overrides:
createDefaultDocumentin classJTextComponent
-
getPreferredSize
- Overrides:
getPreferredSizein classJComponent
-
getColumnWidth
protected int getColumnWidth() -
setFont
- Overrides:
setFontin classJComponent
-
getUIClassID
- Overrides:
getUIClassIDin classJComponent
-
isValidateRoot
public boolean isValidateRoot()- Overrides:
isValidateRootin classJComponent
-
paramString
- Overrides:
paramStringin classJTextComponent
-
getAction
-
setAction
-
configurePropertiesFromAction
-
createActionPropertyChangeListener
-
actionPropertyChanged
-
getActions
- Overrides:
getActionsin classJTextComponent
-
getHorizontalVisibility
-
getScrollOffset
public int getScrollOffset() -
setScrollOffset
public void setScrollOffset(int scrollOffset) Stores the offset without scrolling anything — the browser owns the input's horizontal scroll position, and R_decline_effect_only permits dropping the effect but not the state. -
scrollRectToVisible
- Overrides:
scrollRectToVisiblein classJComponent
-
getAccessibleContext
- Specified by:
getAccessibleContextin interfaceAccessible- Overrides:
getAccessibleContextin classJTextComponent
-