< prev index next >

src/java.desktop/share/classes/javax/swing/JPasswordField.java

Print this page




 235      * look and feel, which typically initiates an error beep.
 236      * The normal behavior of transferring the
 237      * currently selected range in the associated text model
 238      * to the system clipboard, and leaving the contents from
 239      * the model, is not acceptable for a password field.
 240      */
 241     public void copy() {
 242         if (getClientProperty("JPasswordField.cutCopyAllowed") != Boolean.TRUE) {
 243             UIManager.getLookAndFeel().provideErrorFeedback(this);
 244         } else {
 245             super.copy();
 246         }
 247     }
 248 
 249     /**
 250      * Returns the text contained in this <code>TextComponent</code>.
 251      * If the underlying document is <code>null</code>, will give a
 252      * <code>NullPointerException</code>.
 253      * <p>
 254      * For security reasons, this method is deprecated.  Use the
 255      <code>* getPassword</code> method instead.
 256      * @deprecated As of Java 2 platform v1.2,
 257      * replaced by <code>getPassword</code>.
 258      * @return the text
 259      */
 260     @Deprecated
 261     public String getText() {
 262         return super.getText();
 263     }
 264 
 265     /**
 266      * Fetches a portion of the text represented by the
 267      * component.  Returns an empty string if length is 0.
 268      * <p>
 269      * For security reasons, this method is deprecated.  Use the
 270      * <code>getPassword</code> method instead.
 271      * @deprecated As of Java 2 platform v1.2,
 272      * replaced by <code>getPassword</code>.
 273      * @param offs the offset &gt;= 0
 274      * @param len the length &gt;= 0
 275      * @return the text




 235      * look and feel, which typically initiates an error beep.
 236      * The normal behavior of transferring the
 237      * currently selected range in the associated text model
 238      * to the system clipboard, and leaving the contents from
 239      * the model, is not acceptable for a password field.
 240      */
 241     public void copy() {
 242         if (getClientProperty("JPasswordField.cutCopyAllowed") != Boolean.TRUE) {
 243             UIManager.getLookAndFeel().provideErrorFeedback(this);
 244         } else {
 245             super.copy();
 246         }
 247     }
 248 
 249     /**
 250      * Returns the text contained in this <code>TextComponent</code>.
 251      * If the underlying document is <code>null</code>, will give a
 252      * <code>NullPointerException</code>.
 253      * <p>
 254      * For security reasons, this method is deprecated.  Use the
 255      * {@code getPassword} method instead.
 256      * @deprecated As of Java 2 platform v1.2,
 257      * replaced by <code>getPassword</code>.
 258      * @return the text
 259      */
 260     @Deprecated
 261     public String getText() {
 262         return super.getText();
 263     }
 264 
 265     /**
 266      * Fetches a portion of the text represented by the
 267      * component.  Returns an empty string if length is 0.
 268      * <p>
 269      * For security reasons, this method is deprecated.  Use the
 270      * <code>getPassword</code> method instead.
 271      * @deprecated As of Java 2 platform v1.2,
 272      * replaced by <code>getPassword</code>.
 273      * @param offs the offset &gt;= 0
 274      * @param len the length &gt;= 0
 275      * @return the text


< prev index next >