Class BasePasswordField

    • Field Detail

      • m_AnyChangeListeners

        protected Set<ChangeListener> m_AnyChangeListeners
        the listeners for any changes to the text.
      • m_EchoCharChangeListeners

        protected Set<ChangeListener> m_EchoCharChangeListeners
        the listener for any changes to the echo char.
      • m_ShowPopupMenu

        protected boolean m_ShowPopupMenu
        whether to show the popup menu.
      • m_EchoChar

        protected char m_EchoChar
        the echo character in use.
    • Constructor Detail

      • BasePasswordField

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

        public BasePasswordField​(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
      • BasePasswordField

        public BasePasswordField​(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
      • BasePasswordField

        public BasePasswordField​(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
      • BasePasswordField

        public BasePasswordField​(Document doc,
                                 String text,
                                 int columns)
        Constructs a new BaseTextField that uses the given text storage model and the given number of columns. This is the constructor through which the other constructors feed. If the document is null, a default model is created.
        Parameters:
        doc - the text storage to use; if this is null, a default will be provided by calling the createDefaultModel method
        text - the initial string to display, or null
        columns - the number of columns to use to calculate the preferred width >= 0; if columns is set to zero, the preferred width will be whatever naturally results from the component implementation
        Throws:
        IllegalArgumentException - if columns < 0
    • Method Detail

      • initTextField

        protected void initTextField()
        Initializes members.
      • notifyAnyChangeListeners

        protected void notifyAnyChangeListeners()
        Notifies all listeners that some change to the text occurred.
      • addEchoCharChangeListener

        public void addEchoCharChangeListener​(ChangeListener l)
        Adds the listener for listening to echo char changes.
        Parameters:
        l - the listener to add
      • removeEchoCharChangeListener

        public void removeEchoCharChangeListener​(ChangeListener l)
        Removes the listener from listening to echo char changes.
        Parameters:
        l - the listener to remove
      • notifyEchoCharChangeListeners

        protected void notifyEchoCharChangeListeners()
        Notifies all listeners that the echo char changed.
      • createPopupMenu

        protected JPopupMenu createPopupMenu()
        Creates the popup menu.
        Returns:
        the popup menu, null if none created
      • 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. Notifies all echochar change listeners.
        Overrides:
        setEchoChar in class JPasswordField
        Parameters:
        c - the echo character to display
      • 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