Class SelectAllTextOnFocus

  • All Implemented Interfaces:
    java.awt.event.FocusListener, java.util.EventListener

    public final class SelectAllTextOnFocus
    extends java.lang.Object
    implements java.awt.event.FocusListener
    This class is a simple FocusListener that when enabled performs a selectAll() to any JTextComponent.

    Since:
    1.20
    Author:
    Gregory Kotsaftis
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void focusGained​(java.awt.event.FocusEvent evt)
      Focus gained event.
      void focusLost​(java.awt.event.FocusEvent evt)
      Focus lost event.
      boolean isEnabled()
      Gets status flag.
      void setEnabled​(boolean f)
      Sets status flag.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • SelectAllTextOnFocus

        public SelectAllTextOnFocus()
        Constructor.
    • Method Detail

      • isEnabled

        public boolean isEnabled()
        Gets status flag.

        Returns:
        true/false.
      • setEnabled

        public void setEnabled​(boolean f)
        Sets status flag.

        Parameters:
        f - true/false.
      • focusGained

        public void focusGained​(java.awt.event.FocusEvent evt)
        Focus gained event.

        Specified by:
        focusGained in interface java.awt.event.FocusListener
        Parameters:
        evt - The event.
      • focusLost

        public void focusLost​(java.awt.event.FocusEvent evt)
        Focus lost event.

        Specified by:
        focusLost in interface java.awt.event.FocusListener
        Parameters:
        evt - The event.