JPasswordField.doc_第1页
JPasswordField.doc_第2页
JPasswordField.doc_第3页
JPasswordField.doc_第4页
JPasswordField.doc_第5页
已阅读5页,还剩7页未读 继续免费阅读

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

中国软件架构师网 次世代游戏 登录 注册 帮助 窗体顶端 高级搜索 窗体底端编辑实验 创建词条 首页 百科分类 排行榜 随便看看 百科问答 程序员百科 类和对象 Java JPasswordField 发表评论(0) 编辑词条javax.swing类 JPasswordFieldjava.lang.Object java.awt.Component java.awt.Container javax.swing.JComponent javax.swing.text.JTextComponent javax.swing.JTextField javax.swing.JPasswordField所有已实现的接口: ImageObserver, MenuContainer, Serializable, Accessible, Scrollable, SwingConstantspublic class JPasswordFieldextends JTextFieldJPasswordField 是一个轻量级组件,允许编辑一个单行文本,其视图指示键入内容,但不显示原始字符。有关更多信息和示例,请参阅The Java Tutorial中的 How to Use Text Fields 一节。 JPasswordField 与使用 echoChar 设置的 java.awt.TextField 是根本一致的。单独提供它可以较方便地安全更改 JTextField 的 UI 而不影响密码输入。 警告:此类的序列化对象将与以后的 Swing 版本不兼容。当前的序列化支持适用于短期存储或运行相同 Swing 版本的应用程序之间的 RMI。从 1.4 版本开始,已在 java.beans 包中添加了支持所有 JavaBeansTM 长期存储的功能。请参见 XMLEncoder。 嵌套类摘要protected classJPasswordField.AccessibleJPasswordField此类实现对 JPasswordField 类的可访问性支持。 从类 javax.swing.JTextField 继承的嵌套类/接口JTextField.AccessibleJTextField 从类 javax.swing.text.JTextComponent 继承的嵌套类/接口JTextComponent.AccessibleJTextComponent, JTextComponent.KeyBinding 从类 javax.swing.JComponent 继承的嵌套类/接口JComponent.AccessibleJComponent 从类 java.awt.Container 继承的嵌套类/接口Container.AccessibleAWTContainer 从类 java.awt.Component 继承的嵌套类/接口Component.AccessibleAWTComponent, Component.BltBufferStrategy, Component.FlipBufferStrategy 字段摘要 从类 javax.swing.JTextField 继承的字段notifyAction 从类 javax.swing.text.JTextComponent 继承的字段DEFAULT_KEYMAP, FOCUS_ACCELERATOR_KEY 从类 javax.swing.JComponent 继承的字段accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW 从类 java.awt.Component 继承的字段BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT 从接口 javax.swing.SwingConstants 继承的字段BOTTOM, CENTER, EAST, HORIZONTAL, LEADING, LEFT, NEXT, NORTH, NORTH_EAST, NORTH_WEST, PREVIOUS, RIGHT, SOUTH, SOUTH_EAST, SOUTH_WEST, TOP, TRAILING, VERTICAL, WEST 从接口 java.awt.image.ImageObserver 继承的字段ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH 构造方法摘要JPasswordField()构造一个新 JPasswordField,使其具有默认文档、为 null 的开始文本字符串和为 0 的列宽度。JPasswordField(Documentdoc, Stringtxt, intcolumns)构造一个使用给定文本存储模型和给定列数的新 JPasswordField。JPasswordField(intcolumns)构造一个具有指定列数的新的空 JPasswordField。JPasswordField(Stringtext)构造一个利用指定文本初始化的新 JPasswordField。JPasswordField(Stringtext, intcolumns)构造一个利用指定文本和列初始化的新 JPasswordField。 方法摘要voidcopy()对当前外观调用 provideErrorFeedback,这通常启动错误蜂鸣。voidcut()对当前外观调用 provideErrorFeedback,这通常启动错误蜂鸣。booleanechoCharIsSet()如果此 JPasswordField 具有为回显设置的字符,则返回 true。AccessibleContextgetAccessibleContext()返回与此 JPasswordField 关联的 AccessibleContext。chargetEchoChar()返回要用于回显的字符。chargetPassword()返回此 TextComponent 中所包含的文本。StringgetText()已过时。从 Java 2 platform v1.2 开始,由 getPassword 来代替。StringgetText(intoffs, intlen)已过时。从 Java 2 platform v1.2 开始,由 getPassword 来代替。StringgetUIClassID()返回呈现此组件的 L&F 类名。protected StringparamString()返回此 JPasswordField 的字符串表示形式。voidsetEchoChar(charc)设置此 JPasswordField 的回显字符。 从类 javax.swing.JTextField 继承的方法addActionListener, configurePropertiesFromAction, createActionPropertyChangeListener, createDefaultModel, fireActionPerformed, getAction, getActionListeners, getActions, getColumns, getColumnWidth, getHorizontalAlignment, getHorizontalVisibility, getPreferredSize, getScrollOffset, isValidateRoot, postActionEvent, removeActionListener, scrollRectToVisible, setAction, setActionCommand, setColumns, setDocument, setFont, setHorizontalAlignment, setScrollOffset 从类 javax.swing.text.JTextComponent 继承的方法addCaretListener, addInputMethodListener, addKeymap, fireCaretUpdate, getCaret, getCaretColor, getCaretListeners, getCaretPosition, getDisabledTextColor, getDocument, getDragEnabled, getFocusAccelerator, getHighlighter, getInputMethodRequests, getKeymap, getKeymap, getMargin, getNavigationFilter, getPreferredScrollableViewportSize, getScrollableBlockIncrement, getScrollableTracksViewportHeight, getScrollableTracksViewportWidth, getScrollableUnitIncrement, getSelectedText, getSelectedTextColor, getSelectionColor, getSelectionEnd, getSelectionStart, getToolTipText, getUI, isEditable, loadKeymap, modelToView, moveCaretPosition, paste, processInputMethodEvent, read, removeCaretListener, removeKeymap, removeNotify, replaceSelection, select, selectAll, setCaret, setCaretColor, setCaretPosition, setComponentOrientation, setDisabledTextColor, setDragEnabled, setEditable, setFocusAccelerator, setHighlighter, setKeymap, setMargin, setNavigationFilter, setSelectedTextColor, setSelectionColor, setSelectionEnd, setSelectionStart, setText, setUI, updateUI, viewToModel, write 从类 javax.swing.JComponent 继承的方法addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, 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, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, 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, update 从类 java.awt.Container 继承的方法add, 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, transferFocusBackward, transferFocusDownCycle, validate, validateTree 从类 java.awt.Component 继承的方法action, 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, hide, 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, transferFocusUpCycle 从类 java.lang.Object 继承的方法clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait 构造方法详细信息JPasswordFieldpublic JPasswordField()构造一个新 JPasswordField,使其具有默认文档、为 null 的开始文本字符串和为 0 的列宽度。 JPasswordFieldpublic JPasswordField(Stringtext)构造一个利用指定文本初始化的新 JPasswordField。将文档模型设置为默认值,列数为 0。 参数: text - 要显示的文本;如果没有文本,则为 nullJPasswordFieldpublic JPasswordField(intcolumns)构造一个具有指定列数的新的空 JPasswordField。创建一个默认模型,并将其初始字符串设置为 null。 参数: columns - 列数,它 = 0JPasswordFieldpublic JPasswordField(Stringtext, intcolumns)构造一个利用指定文本和列初始化的新 JPasswordField。将文档模型设置为默认值。 参数: text - 要显示的文本;如果不存在文本,则为 null columns - 列数,它 = 0JPasswordFieldpublic JPasswordField(Documentdoc, Stringtxt, intcolumns)构造一个使用给定文本存储模型和给定列数的新 JPasswordField。其他构造方法馈通此构造方法。将回显字符设置为 *。如果文档模型为 null,则创建默认文档。 参数: doc - 要使用的文本存储 txt - 要显示的文本;如果不存在文本,则为 null columns - 用于计算首选宽度的列数,它 = 0;如果将列数设置为零,则首选宽度将从组件实现自然产生方法详细信息getUIClassIDpublic String getUIClassID()返回呈现此组件的 L&F 类名。 覆盖: 类 JTextField 中的 getUIClassID返回: 字符串 PasswordFieldUI 另请参见: JComponent.getUIClassID(), UIDefaults.getUI(javax.swing.JComponent)getEchoCharpublic char getEchoChar()返回要用于回显的字符。默认值为 *。 返回: 回显字符;如果未设置,则返回 0 另请参见: setEchoChar(char), echoCharIsSet()setEchoCharpublic void setEchoChar(charc)设置此 JPasswordField 的回显字符。注意,这仅仅是一个建议,因为安装的视图可以使用它所需要的任何图形技术来表示字段。将值设置为 0 指示希望按照键入查看文本,类似于标准 JTextField 的行为。 参数: c - 要显示的回显字符 另请参见: echoCharIsSet(), getEchoChar()echoCharIsSetpublic boolean echoCharIsSet()如果此 JPasswordField 具有为回显设置的字符,则返回 true。如果回显字符不为 0,则考虑设置字符。 返回: 如果为回显设置了字符,则返回 true 另请参见: setEchoChar(char), getEchoChar()cutpublic void cut()对当前外观调用 provideErrorFeedback,这通常启动错误蜂鸣。将关联模型中的当前选定范围传输到系统剪贴板并从模型中移除内容,这种普通行为对于密码字段而言,是不可接受的。 覆盖: 类 JTextComponent 中的 cut另请参见: Toolkit.getSystemClipboard(), Clipboardcopypublic void copy()对当前外观调用 provideErrorFeedback,这通常启动错误蜂鸣。将关联模型中的当前选定范围传输到系统剪贴板并在模型中保留内容,这种普通行为对于密码字段而言,是不可接受的。 覆盖: 类 JTextComponent 中的 copy另请参见: Toolkit.getSystemClipboard(),

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论