jdk/src/share/classes/javax/swing/JPasswordField.java
Print this page
*** 23,39 ****
* questions.
*/
package javax.swing;
import javax.swing.text.*;
- import javax.swing.plaf.*;
import javax.accessibility.*;
import java.io.ObjectOutputStream;
- import java.io.ObjectInputStream;
import java.io.IOException;
- import java.io.*;
import java.util.Arrays;
/**
* <code>JPasswordField</code> is a lightweight component that allows
* the editing of a single line of text where the view indicates
--- 23,38 ----
* questions.
*/
package javax.swing;
import javax.swing.text.*;
import javax.accessibility.*;
+ import java.beans.JavaBean;
+ import java.beans.BeanProperty;
import java.io.ObjectOutputStream;
import java.io.IOException;
import java.util.Arrays;
/**
* <code>JPasswordField</code> is a lightweight component that allows
* the editing of a single line of text where the view indicates
*** 66,82 ****
* the same version of Swing. As of 1.4, support for long term storage
* of all JavaBeans™
* has been added to the <code>java.beans</code> package.
* Please see {@link java.beans.XMLEncoder}.
*
- * @beaninfo
- * attribute: isContainer false
- * description: Allows the editing of a line of text but doesn't show the characters.
- *
* @author Timothy Prinzing
* @since 1.2
*/
@SuppressWarnings("serial") // Same-version serialization only
public class JPasswordField extends JTextField {
/**
* Constructs a new <code>JPasswordField</code>,
--- 65,79 ----
* the same version of Swing. As of 1.4, support for long term storage
* of all JavaBeans™
* has been added to the <code>java.beans</code> package.
* Please see {@link java.beans.XMLEncoder}.
*
* @author Timothy Prinzing
* @since 1.2
*/
+ @JavaBean(description = "Allows the editing of a line of text but doesn't show the characters.")
+ @SwingContainer(false)
@SuppressWarnings("serial") // Same-version serialization only
public class JPasswordField extends JTextField {
/**
* Constructs a new <code>JPasswordField</code>,
*** 149,158 ****
--- 146,156 ----
*
* @return the string "PasswordFieldUI"
* @see JComponent#getUIClassID
* @see UIDefaults#getUI
*/
+ @BeanProperty(bound = false)
public String getUIClassID() {
return uiClassID;
}
*** 189,202 ****
* the behavior of a standard <code>JTextField</code>.
*
* @param c the echo character to display
* @see #echoCharIsSet
* @see #getEchoChar
- * @beaninfo
- * description: character to display in place of the real characters
- * attribute: visualUpdate true
*/
public void setEchoChar(char c) {
echoChar = c;
echoCharSet = true;
repaint();
revalidate();
--- 187,199 ----
* the behavior of a standard <code>JTextField</code>.
*
* @param c the echo character to display
* @see #echoCharIsSet
* @see #getEchoChar
*/
+ @BeanProperty(bound = false, visualUpdate = true, description
+ = "character to display in place of the real characters")
public void setEchoChar(char c) {
echoChar = c;
echoCharSet = true;
repaint();
revalidate();
*** 290,299 ****
--- 287,297 ----
* security, it is recommended that the returned character array be
* cleared after use by setting each character to zero.
*
* @return the text
*/
+ @BeanProperty(bound = false)
public char[] getPassword() {
Document doc = getDocument();
Segment txt = new Segment();
try {
doc.getText(0, doc.getLength(), txt); // use the non-String API
*** 381,390 ****
--- 379,389 ----
*
* @return an <code>AccessibleJPasswordField</code> that serves as the
* <code>AccessibleContext</code> of this
* <code>JPasswordField</code>
*/
+ @BeanProperty(bound = false)
public AccessibleContext getAccessibleContext() {
if (accessibleContext == null) {
accessibleContext = new AccessibleJPasswordField();
}
return accessibleContext;