JPasswordField (tag)

From JAXXWiki

The <JPasswordField> tag creates an instance of javax.swing.JPasswordField. As with all Swing tags, the package name is assumed only because javax.swing is imported by default. The fully qualified form of this tag is <javax.swing.JPasswordField>.

This information is based on the Java Development Kit version 5.0. Other versions of Java may have more or fewer features.

Contents

Attributes

These attributes may appear on the <JPasswordField> tag. As XML is a text file format, all attribute values must be represented as strings — either strings which can be converted into the destination type (e.g. height="1234" for the int-typed attribute height) or strings of Java code in curly braces (e.g. border="{BorderFactory.createEtchedBorder()}" for the Border-typed attribute border). See Data types for more information.

Attributes specific to JPasswordField

These attributes are defined by JPasswordField (or its TagHandler).

AttributeTypeDescription
echoCharcharEquivalent to setEchoChar()

Attributes inherited from JTextField

These attributes are common to all classes that descend from javax.swing.JTextField.

AttributeTypeDescription
actionjavax.swing.ActionEquivalent to setAction()
actionCommandjava.lang.StringEquivalent to setActionCommand()
columnsintEquivalent to setColumns()
horizontalAlignmentintEquivalent to setHorizontalAlignment()

Must be one of left, center, right, leading, or trailing

scrollOffetintEquivalent to setScrollOffset()

Attributes inherited from JTextComponent

These attributes are common to all classes that descend from javax.swing.text.JTextComponent.

AttributeTypeDescription
caretjavax.swing.text.CaretEquivalent to setCaret()
caretColorjava.awt.ColorEquivalent to setCaretColor()
caretPositionintEquivalent to setCaretPosition()
componentOrientationjava.awt.ComponentOrientationEquivalent to setComponentOrientation()
disabledTextColorjava.awt.ColorEquivalent to setDisabledTextColor()
documentjavax.swing.text.DocumentEquivalent to setDocument()
dragEnabledbooleanEquivalent to setDragEnabled()
editablebooleanEquivalent to setEditable()
focusAcceleratorcharEquivalent to setFocusAccelerator()
highlighterjavax.swing.text.HighlighterEquivalent to setHighlighter()
keyMapjavax.swing.text.KeymapEquivalent to setKeyMap()
marginjava.awt.InsetsEquivalent to setMargin()
selectedTextColorjava.awt.ColorEquivalent to setSelectedTextColor()
selectionColorjava.awt.ColorEquivalent to setSelectionColor()
selectionEndintEquivalent to setSelectionEnd()
selectionStartintEquivalent to setSelectionStart()
textjava.lang.StringEquivalent to setText()

Attributes inherited from JComponent

These attributes are common to all classes that descend from javax.swing.JComponent.

AttributeTypeDescription
actionMapjavax.swing.ActionMapEquivalent to setActionMap()
alignmentXfloatEquivalent to setAlignmentX()
alignmentYfloatEquivalent to setAlignmentY()
autoscrollsbooleanEquivalent to setAutoscrolls()
backgroundjava.awt.ColorEquivalent to setBackground()
borderjavax.swing.border.BorderEquivalent to setBorder()
componentPopupMenujavax.swing.JPopupMenuEquivalent to setComponentPopupMenu()
debugGraphicsOptionsintEquivalent to setDebugGraphicsOptions()
defaultLocalejava.util.LocaleEquivalent to setDefaultLocale()
doubleBufferedbooleanEquivalent to setDoubleBuffered()
enabledbooleanEquivalent to setEnabled()
fontjava.awt.FontEquivalent to setFont()
foregroundjava.awt.ColorEquivalent to setForeground()
inheritsPopupMenubooleanEquivalent to setInheritsPopupMenu()
inputVerifierjavax.swing.InputVerifierEquivalent to setInputVerifier()
enabledbooleanEquivalent to setEnabled()
maximumSizejava.awt.DimensionEquivalent to setMaximumSize()
minimumSizejava.awt.DimensionEquivalent to setMinimumSize()
nextFocusableComponentjava.awt.ComponentEquivalent to setNextFocusableComponent()
opaquebooleanEquivalent to setOpaque()
preferredSizejava.awt.DimensionEquivalent to setPreferredSize()
requestFocusEnabledbooleanEquivalent to setRequestFocusEnabled()
toolTipTextjava.lang.StringEquivalent to setToolTipText()
transferHandlerjavax.swing.TransferHandlerEquivalent to setTransferHandler()
verifyInputWhenFocusTargetbooleanEquivalent to setVerifyInputWhenFocusTarget()
visiblebooleanEquivalent to setVisible()

Attributes inherited from Container

These attributes are common to all classes that descend from java.awt.Container.

AttributeTypeDescription
focusCycleRootbooleanEquivalent to setFocusCycleRoot()
focusTraversalPolicyjava.awt.FocusTraversalPolicyEquivalent to setFocusTraversalPolicy()
focusTraversalPolicyProviderbooleanEquivalent to setFocusTraversalPolicyProvider()
layoutjava.awt.LayoutManagerEquivalent to setLayout()

Attributes inherited from Component

These attributes are common to all classes that descend from java.awt.Component.

AttributeTypeDescription
boundsjava.awt.RectangleEquivalent to setBounds()
componentOrientationjava.awt.ComponentOrientationEquivalent to setComponentOrientation()
cursorjava.awt.CursorEquivalent to setCursor()
dropTargetjava.awt.dnd.DropTargetEquivalent to setDropTarget()
focusablebooleanEquivalent to setFocusable()
focusTraversalKeysEnabledbooleanEquivalent to setFocusTraversalKeysEnabled()
font-facejava.lang.StringSets the component's font face, e.g. "Times New Roman"
font-sizeintSets the component's font size
font-stylejava.lang.StringSets the component's font style
Must be either normal or italic
font-weightjava.lang.StringSets the component's font weight
Must be either normal or bold
heightintSets the component's height (more information)
ignoreRepaintbooleanEquivalent to setIgnoreRepaint()
locationjava.awt.PointEquivalent to setLocation()
namejava.lang.StringEquivalent to setName()
sizejava.awt.DimensionEquivalent to setSize()
widthintSets the component's width (more information)

JAXX attributes

These attributes are common to all JAXX class tags.

AttributeTypeDescription
constraintsjava.lang.ObjectLayout constraints to be used when adding to parent (full documentation)
constructorParamscomma-separated Java expressionsParameters to be passed to object's constructor (full documentation)
idjava.lang.StringName used to refer to object elsewhere in file (full documentation)
styleClassjava.lang.StringCSS style class (full documentation)

Events

You can listen to events by assigning Java code to an event handler, such as onActionPerformed='dispose()'. The Java code will be invoked when the event is fired. See event handlers for more details.

Events inherited from JTextField

These events are common to all classes that descend from javax.swing.JTextField.

EventListener classDescription
onActionPerformedActionListenerInvoked when an action occurs.

Events inherited from JTextComponent

These events are common to all classes that descend from javax.swing.text.JTextComponent.

EventListener classDescription
onCaretUpdateCaretListenerCalled when the caret position is updated.
onCaretPositionChangedInputMethodListenerInvoked when the caret within composed text has changed.
onInputMethodTextChangedInputMethodListenerInvoked when the text entered through an input method has changed.

Events inherited from JComponent

These events are common to all classes that descend from javax.swing.JComponent.

EventListener classDescription
onAncestorAddedAncestorListenerCalled when the source or one of its ancestors is made visible either by setVisible(true) being called or by its being added to the component hierarchy.
onAncestorMovedAncestorListenerCalled when either the source or one of its ancestors is moved.
onAncestorRemovedAncestorListenerCalled when the source or one of its ancestors is made invisible either by setVisible(false) being called or by its being remove from the component hierarchy.
onVetoableChangeVetoableChangeListenerCalled when a constrained property is changed.

Events inherited from Container

These events are common to all classes that descend from java.awt.Container.

EventListener classDescription
onComponentAddedContainerListenerInvoked when a component has been added to the container.
onComponentRemovedContainerListenerInvoked when a component has been removed from the container.
onPropertyChangePropertyChangeListenerCalled when a bound property is changed.

Events inherited from Component

These events are common to all classes that descend from java.awt.Component.

EventListener classDescription
onAncestorResizedHeirarchyBoundsListenerCalled when an ancestor of the source is resized.
onCaretPositionChangedInputMethodListenerInvoked when the caret within composed text has changed.
onComponentHiddenComponentListenerInvoked when the component has been made invisible.
onComponentMovedComponentListenerInvoked when the component's position changes.
onComponentResizedComponentListenerInvoked when the component's size changes.
onComponentShownComponentListenerInvoked when the component has been made visible.
onFocusGainedFocusListenerInvoked when a component gains the keyboard focus.
onFocusLostFocusListenerInvoked when a component loses the keyboard focus.
onHeirarchyChangedHeirarchyListenerCalled when the hierarchy has been changed.
onInputMethodTextChangedInputMethodListenerInvoked when the text entered through an input method has changed.
onKeyPressedKeyListenerInvoked when a key has been pressed.
onKeyReleasedKeyListenerInvoked when a key has been released.
onKeyTypedKeyListenerInvoked when a key has been typed.
onMouseClickedMouseListenerInvoked when the mouse button has been clicked (pressed and released) on a component.
onMouseDraggedMouseMotionListenerInvoked when a mouse button is pressed on a component and then dragged.
onMouseEnteredMouseListenerInvoked when the mouse enters a component.
onMouseExitedMouseListenerInvoked when the mouse exits a component.
onMouseMovedMouseMotionListenerInvoked when the mouse cursor has been moved onto a component but no buttons have been pushed.
onMousePressedMouseListenerInvoked when a mouse button has been pressed on a component.
onMouseReleasedMouseListenerInvoked when a mouse button has been released on a component.
onMouseWheelMovedMouseWheelListenerInvoked when the mouse wheel is rotated.
bastrocc4td

Bound methods

A bound method is a method whose value can be tracked by listening to events. For instance, changes to the return value of Component.getWidth() are always accompanied by componentResized events.

Bound methods are significant because they allow the data binding system to detect when they have changed. If you call a bound method within a data binding expression, JAXX will add an event listener in order to detect changes to the method's value. Methods which are not listed below cannot be tracked by JAXX's data binding.

delbocnae coracdronpas dronelch cbocboac oroloo

Bound methods inherited from JTextField

These methods are bound in all components that descend from javax.swing.JTextField.

  • getAction()
  • getHorizontalAlignment()

delbocnae coracdronpas dronelch cbocboac oroloo

Bound methods inherited from JTextComponent

These methods are bound in all components that descend from javax.swing.text.JTextComponent.

  • getCaret()
  • getCaretColor()
  • getDisabledTextColor()
  • getDocument()
  • getFocusAccelerator()
  • getHighlighter()
  • getKeymap()
  • getMargin()
  • getSelectedTextColor()
  • getSelectionColor()
  • getText()
  • isEditable()

delbocnae coracdronpas dronelch cbocboac oroloo

Bound methods inherited from JComponent

These methods are bound in all components that descend from javax.swing.JComponent.

  • isEnabled()

delbocnae coracdronpas dronelch cbocboac oroloo

Bound methods inherited from Container

These methods are bound in all components that descend from java.awt.Container.

  • getChildCount()

delbocnae coracdronpas dronelch cbocboac oroloo

Bound methods inherited from Component

These methods are bound in all components that descend from java.awt.Component.

  • hasFocus()
  • getBackground()
  • getBounds()
  • getHeight()
  • getFont()
  • getForeground()
  • getLocation()
  • getLocationOnScreen()
  • getSize()
  • getWidth()
  • getX()
  • getY()
  • isFocusable()
  • isVisible()tasitoloc

See also