jPasswordField


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 3 of 3

Thread: jPasswordField

  1. #1
    rob Guest

    jPasswordField



    Is there a good way to 'setText' in a jPasswordField? There is only a
    getPassword method and the PasswordField seems to only take input from the
    keyboard. I need it to accept input from button clicks. I am making a keyboard
    on the screen to be clicked for a handheld PDA that has no keys.

    can't use a plain jTextField because it has no EchoChar.

    I think I cannot use Swing on a handheld anyway so maybe this is academic.
    It does seem to be an oversight because Suns tutorial talks about both get
    and set methods but only shows getPassword.

    Thanks

  2. #2
    Kent Guest

    Re: jPasswordField


    Rob,

    JPasswordField extends the JTextField class so you can just use setText(String)
    as per the JTextField class. getPassword() is provided instead of getText()
    for security reasons not relevant to plain text fields.

    Regards,
    Kent

    "rob" <robert.s.cascella@lmco.com> wrote:
    >
    >
    >Is there a good way to 'setText' in a jPasswordField? There is only a
    >getPassword method and the PasswordField seems to only take input from the
    >keyboard. I need it to accept input from button clicks. I am making a keyboard
    >on the screen to be clicked for a handheld PDA that has no keys.
    >
    >can't use a plain jTextField because it has no EchoChar.
    >
    >I think I cannot use Swing on a handheld anyway so maybe this is academic.
    >It does seem to be an oversight because Suns tutorial talks about both get
    >and set methods but only shows getPassword.
    >
    >Thanks



  3. #3
    Rob Guest

    Re: jPasswordField


    "rob" <robert.s.cascella@lmco.com> wrote:
    >
    >
    >Is there a good way to 'setText' in a jPasswordField? There is only a
    >getPassword method and the PasswordField seems to only take input from the
    >keyboard. I need it to accept input from button clicks. I am making a keyboard
    >on the screen to be clicked for a handheld PDA that has no keys.
    >
    >can't use a plain jTextField because it has no EchoChar.
    >
    >I think I cannot use Swing on a handheld anyway so maybe this is academic.
    >It does seem to be an oversight because Suns tutorial talks about both get
    >and set methods but only shows getPassword.
    >
    >Thanks



Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center