Class BasePasswordFieldWithButton

    • Field Detail

      • m_Button

        protected BaseButton m_Button
        the button for showing/hiding the password.
    • Constructor Detail

      • BasePasswordFieldWithButton

        public BasePasswordFieldWithButton()
        Constructs a new TextField. A default model is created, the initial string is null, and the number of columns is set to 0.
      • BasePasswordFieldWithButton

        public BasePasswordFieldWithButton​(String text)
        Constructs a new TextField initialized with the specified text. A default model is created and the number of columns is 0.
        Parameters:
        text - the text to be displayed, or null
      • BasePasswordFieldWithButton

        public BasePasswordFieldWithButton​(int columns)
        Constructs a new empty TextField with the specified number of columns. A default model is created and the initial string is set to null.
        Parameters:
        columns - the number of columns to use to calculate the preferred width; if columns is set to zero, the preferred width will be whatever naturally results from the component implementation
      • BasePasswordFieldWithButton

        public BasePasswordFieldWithButton​(String text,
                                           int columns)
        Constructs a new TextField initialized with the specified text and columns. A default model is created.
        Parameters:
        text - the text to be displayed, or null
        columns - the number of columns to use to calculate the preferred width; if columns is set to zero, the preferred width will be whatever naturally results from the component implementation
    • Method Detail

      • initGUI

        protected void initGUI()
        Initializes the members.
        Overrides:
        initGUI in class BasePanel
      • getPassword

        public char[] getPassword()
        Returns the text contained in this TextComponent. If the underlying document is null, will give a NullPointerException. For stronger security, it is recommended that the returned character array be cleared after use by setting each character to zero.
        Returns:
        the text
      • setText

        public void setText​(String t)
        Sets the password.
        Parameters:
        t - the password
      • getEchoChar

        public char getEchoChar()
        Returns the character to be used for echoing. The default is '*'. The default may be different depending on the currently running Look and Feel. For example, Metal/Ocean's default is a bullet character.
        Returns:
        the echo character, 0 if unset
      • setEchoChar

        public void setEchoChar​(char c)
        Sets the echo character for this JPasswordField. Note that this is largely a suggestion, since the view that gets installed can use whatever graphic techniques it desires to represent the field. Setting a value of 0 indicates that you wish to see the text as it is typed, similar to the behavior of a standard JTextField.
        Parameters:
        c - the echo character to display
      • echoCharIsSet

        public boolean echoCharIsSet()
        Returns true if this JPasswordField has a character set for echoing. A character is considered to be set if the echo character is not 0.
        Returns:
        true if a character is set for echoing
      • getColumns

        public int getColumns()
        Returns the number of columns in this TextField.
        Returns:
        the number of columns >= 0
      • setColumns

        public void setColumns​(int columns)
        Sets the number of columns in this TextField, and then invalidate the layout.
        Parameters:
        columns - the number of columns >= 0
        Throws:
        IllegalArgumentException - if columns is less than 0
      • setShowPopupMenu

        public void setShowPopupMenu​(boolean value)
        Sets whether to show the popup menu.
        Parameters:
        value - true if to show
      • getShowPopupMenu

        public boolean getShowPopupMenu()
        Returns whether the popup menu is shown.
        Returns:
        true if shown
      • setBasePassword

        public void setBasePassword​(BasePassword value)
        Sets the password.
        Parameters:
        value - the password
      • getBasePassword

        public BasePassword getBasePassword()
        Return the password.
        Returns:
        the password
      • setPasswordVisible

        public void setPasswordVisible​(boolean value)
        Shows or hides the password.
        Parameters:
        value - true if to show
      • isPasswordVisible

        public boolean isPasswordVisible()
        Returns whether the password is shown or hidden.
        Returns:
        true if shown
      • setEnabled

        public void setEnabled​(boolean b)
        Enables (or disables) the field/button.
        Overrides:
        setEnabled in class JComponent
        Parameters:
        b - true to enable the field/button, otherwise false
      • isEnabled

        public boolean isEnabled()
        Returns whether the field/button are enabled.
        Overrides:
        isEnabled in class Component
        Returns:
        true if enabled
      • getField

        public BasePasswordField getField()
        Returns the underlying password field.
        Returns:
        the field
      • getButton

        public BaseButton getButton()
        Returns the underlying button.
        Returns:
        the button